I want to solve some optimization problem involving matrices. A toy example related to the problem looks as follows
Ma = Table[RandomVariate[UniformDistribution[{0, 1}]], {q1, 1, 10}, {q2, 1, 10}];
Minimize[{Norm[Part[Ma, 1;;10-d1, 1;;10-d2]-Part[Ma,d1+1;;10, d2 + 1 ;; 10], 2]^2/(10-d1)/(10-d2),And[1 <= d1, d1 <= 5, d2 >= 1, d2 <= 5],Element[ Alternatives[d2, d1], Integers]}, {d1, d2}]
Minimize
does not recognize 10-d1
, 10-d2
as a valid Span specification, though returns the valid solution. Obviously, this problem can be solved without use of Minimize
, but for certain reasons it is more convenient to use Minimize
or NMinimize