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

조회 수: 4 (최근 30일)
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);

답변 (1개)

Torsten
Torsten 2016년 8월 1일
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
Flora
Flora 2016년 8월 4일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Surrogate Optimization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by