Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Error : Matrix dimensions must agree

2 vues (au cours des 30 derniers jours)
Ahmad Sheikh
Ahmad Sheikh le 24 Oct 2015
Clôturé : MATLAB Answer Bot le 20 Août 2021
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?

Réponses (1)

dpb
dpb le 24 Oct 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 commentaires
Ahmad Sheikh
Ahmad Sheikh le 24 Oct 2015
Modifié(e) : Ahmad Sheikh le 24 Oct 2015
well
P=lmivar (1,[12 1])
it doesnt show that P is a 12x1 matrix.
dpb
dpb le 24 Oct 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?

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by