How to use matlab to find an optimized matrix with regarding to minimization of a norm?

6 Ansichten (letzte 30 Tage)
I’m trying to solve a minimization problem whose purpose is to optimize a matrix, where the multiplication with a vector is close to another vector. But I have some problems to execute it by using Matlab. The problem is illustrated as follows:
The summation goes to 15, because there are 15 unique vector pairs of u and b. Which function in Matlab can I use to solve this issue? I thought “fmincon” is an option, but I could not get the input parameters correct
X0=ones(1,9)/3;
Aeq=
beq=ones(3,1);
ub=2*ones(1,9);
lb=-2*ones(1,6);
x = fmincon(????,x0,[],[],Aeq,beq,lb,ub);

Antworten (1)

Torsten
Torsten am 1 Aug. 2016
Try
function main
Aeq=[1 1 1 0 0 0 0 0 0
0 0 0 1 1 1 0 0 0
0 0 0 0 0 0 1 1 1];
beq=ones(3,1);
lb=-2*ones(1,9);
ub=2*ones(1,9);
U=horzcat(u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15);
B=horzcat(b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13,b14,b15);
x0=ones(1,9)/3;
fun=@(x)(norm([x(1) x(2) x(3);x(4) x(5) x(6);x(7) x(8) x(9)]*U-B,'fro'));
x=fmincon(fun,x0,[],[],Aeq,beq,lb,ub);
Best wishes
Torsten.
  1 Kommentar
Flora
Flora am 4 Aug. 2016
Thanks, it works.
The result is not that optimal as I wished, but probably I have to change the criteria. Or need to find another way to do this. For different vector pairs the difference between vector Q*ui and bi is more than 15 for a vector element. This is also observed for the matrix Q, when it is optimized for each vector pair. For each element the value could vary with 1.

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by