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
0 个评论
回答(1 个)
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
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 Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!