I'm trying to find the matrix x which minimize the following cost function :
$J =||B_b -x*B_n||^2$
with the constraint that x has to be an orthonormal matrix. I'm trying to use MATLAB fmincon tool, but I'm kind of stucked in how to pose the problem to the solver. What I did up until now is writing an objective function like this :
function f=objfun(x)
B_b = [8.53086963374351e-06,-1.56083520340848e-06,2.62167147268028e-05];
B_n = [-8.53086963374351e-06,1.56083520340848e-06,2.62167147268028e-05];
f = (norm(B_b' - x*B_n'))^2; % Cost function
The costraints can be expressed as :
$det(x) = 1$
$trace(I-x'x) = 0 $
Where I is the identity matrix. But I don't get how to write them for MATLAB's fmincon.
Can someone help me to realize what I'm doing wrong in posing the problem to MATLAB and how I can express the costraint to solve this costrained problem ?