Error using * Inner matrix dimensions must agree.

2 次查看(过去 30 天)
error in matrix
  7 个评论
Walter Roberson
Walter Roberson 2019-1-18
dbstop if error
run the code. when it stops look at the sizes of all of the variables involved and extract portions of the expression until you figure out which multiplication is triggering the error and what the sizes are of the left and right. Then you trace backwards in the code to figure out why they got to be that size.

请先登录,再进行评论。

采纳的回答

madhan ravi
madhan ravi 2019-1-17
编辑:madhan ravi 2019-1-17
Use size() to check the sizes of the variables if they have compatible sizes ( https://www.mathworks.com/help/matlab/matlab_prog/compatible-array-sizes-for-basic-operations.html#responsive_offcanvas ) .

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Whos 的更多信息

产品


版本

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by