Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Error : Matrix dimensions must agree
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I have written the follwing LMI in matlab
(A1-B*F1)' * P * (A1-B*F1) - P < 0
where, A1 is a 12 x 12 matrix B is a 12 x 4 matrix and F1 is a 4 x 12 matrix
A1=[0 0 0 0 0 0 1 0 0 0 0 0;0 0 0 0 0 0 0 1 0 0 0 0;0 0 0 0 0 0 0 0 1 0 0 0;0 0 0 0 0 0 0 0 0 0 0 1;0 0 0 0 0 0 0 0 0 0 1 0;0 0 0 0 0 0 0 0 0 1 0 0;0 0 0 0 -9.4757 2.539 0 0 0 0 0 0;0 0 0 0 2.539 9.4757 0 0 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0 0];
B=[0 0 0 0;0 0 0 0;0 0 0 0;0 0 0 0;0 0 0 0;0 0 0 0;0 0 0 0;0 0 0 0;-1.4286 0 0 0;0 0.24162 0 0;0 0 0.24162 0;0 0 0 0.80541];
setlmis([]);
P=lmivar(1,[12 1]);
F1=lmivar(2,[4 12]);
lmiterm([1 1 1 P],(A1-B*F1)',(A1-B*F1));
lmiterm([1 1 1 P],1,-1);lmis=getlmis;
[tmin,xfeas]=feasp(lmis);
f1=dec2mat(lmis,xfeas,F1)
but its giving an error '' Matrix dimensions must agree '' can some one help why?
0 comentarios
Respuestas (1)
dpb
el 24 de Oct. de 2015
(A1-B*F1)' * P * (A1-B*F1) - P < 0
where, A1 is a 12 x 12 matrix B is a 12 x 4 matrix and F1 is a 4 x 12 matrix
(A1-B*F1)' * P * (A1-B*F1)
[12x12] * [12 1] --> [12x1] * [12x12]
BOOM! You're trying to multiply a column vector on the left of the square array...
2 comentarios
Ahmad Sheikh
el 24 de Oct. de 2015
Editada: Ahmad Sheikh
el 24 de Oct. de 2015
dpb
el 24 de Oct. de 2015
Oh, yeah? Syntax surely looks like it would be....so what is it?
But whatever, work thru the expression as shown; bound to find somewhere it breaks down -- maybe there's a problem in association/precedence in computer evaluation from what is intended mathematically?
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!