Matrix dimensions must agree Error

2 vues (au cours des 30 derniers jours)
Sencer Comert
Sencer Comert le 16 Nov 2019
Commenté : Walter Roberson le 16 Nov 2019
I get the matrix dimmensions must agree error for the following code.
Can someone tell me how to fix?
B=[m2ag2x;m2ag2y;F32x;m3ag3x;m3ag3y;Mfp;m4ag4x;0]
A=[1 0 1 0 0 0 0 0
0 1 0 1 0 0 0 0
-R12y R12x -R32y R32x 0 0 0 1
0 0 -1 0 1 0 0 0
0 0 0 -1 0 1 0 0
0 0 R23y -R23x -R43y R43x 0 0
0 0 0 0 -1 0 mu 0
0 0 0 0 0 -1 1 0]
F=A/B

Réponses (1)

Daniel M
Daniel M le 16 Nov 2019
Modifié(e) : Daniel M le 16 Nov 2019
A is [8x8] and B is [8x1]. Do you mean to do the mrdivide operation, "/"? Or do you mean to do element-wise division "./"? If the former, do
F = A/B.'; % F is [8x1]
If the latter do
F = A./B; % F is [8x8]
  1 commentaire
Walter Roberson
Walter Roberson le 16 Nov 2019
This is one of the rare cases where A/B' is apparently more correct than A/B.'
I have a hard time following why you use conjugate transpose in these kinds of calculations instead of plain transpose, but I pretty consistently see conjugate transpose used for this situation. Because I do not understand it, I cannot describe why you would or would not want to use conjugate for this situation.
.' compared to ' only makes a difference if some of the entries are complex valued, though.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by