Matrix dimensions must agree Error

1 次查看(过去 30 天)
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

回答(1 个)

Daniel M
Daniel M 2019-11-16
编辑:Daniel M 2019-11-16
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 个评论
Walter Roberson
Walter Roberson 2019-11-16
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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by