minimize a function with matrix output subject to a constrain

1 view (last 30 days)
Dear all, I have another question about minimizing a function using Matlab. I already post a question here: Minimizing Function With Matrix Output and the result is as what I expected, matrix output. But the value is still incorrect. I forgot that the function has a constrain. Here is my code:
function f=obj1(C,H12,H21,F1,F2)
f=norm(H12*F2-C(:,1)*C(:,1)'*H12*F2)^2+norm(H21*F1-C(:,2)*C(:,2)'*H21*F1)^2;
Here is how I call the function:
find_C = @(T) obj1(T, H(:,:,1,2), H(:,:,2,1), F(:,:,1), F(:,:,2));
guess=rand(3,2);
Cout = fminsearch(find_C, guess,options);
C(:,:,1)=Cout(:,1);
C(:,:,2)=Cout(:,2);
H12 and H21 are 3x3 matrix, F1 and F2 are 3x1 matrix. I want to minimize the function to find C(:,1) and C(:,2) and it should be a 3x1 matrix, with constrain C(:,2)*C(:,2)'=I and C(:,1)*C(:,1)'=I (identity matrix).
I read about fmincon, but I thought the constrain is different. Do you have any idea to solve this?
Thank you!

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!