help me to fix this problem
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论
In an assignment A(I) = B, the number of elements in B and I must be the same.
Error in cuba (line 90)
y_7(i+1) = y_7(i)+16*l_1/135+6656*l_3/12825+28561*l_4/56430-9*l_5/50+2*l_6/55;
0 个评论
回答(1 个)
Jan
2018-7-15
Use the debugger, see e.g. https://www.mathworks.com/help/matlab/matlab_prog/debugging-process-and-features.html. You can type this in the command window:
dbstop if error
Then run the code again. When Matlab stops at the error, check the dimensions of the variables, either in the Workspace-Browser, or in the command window:
size(y_7(i)+16*l_1/135+6656*l_3/12825+28561*l_4/56430-9*l_5/50+2*l_6/55)
size(y_7)
size(l_1)
size(l_3)
size(l_4)
size(l_5)
size(l_6)
The error message means, that the expression on the right side is not a scalar, but the one on the left side is.
0 个评论
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!