Matrix dimensions must agree Error

3 Ansichten (letzte 30 Tage)
Sencer Comert
Sencer Comert am 16 Nov. 2019
Kommentiert: Walter Roberson am 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

Antworten (1)

Daniel M
Daniel M am 16 Nov. 2019
Bearbeitet: Daniel M am 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 Kommentar
Walter Roberson
Walter Roberson am 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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by