I got this this error when I run the program (Error while parsing expression)
6 ビュー (過去 30 日間)
古いコメントを表示
Mohammed AL-hadi
2021 年 8 月 7 日
コメント済み: Mohammed AL-hadi
2021 年 8 月 7 日
I am using a function with different inputs but I got this error
Error while parsing expression: (((u(1))–(cax*(u(2))*(u(2)))–(jr*(u(5))*(u(3)))–((iz-iy)*(u(3))*(u(4))))/(ix)) in 'Final_Modelling_Sub/Quadcopter System Dynamics/Translational & Rotational Dynamics/Phidd Equation1' token "" was found, whereas ")" was expected

0 件のコメント
採用された回答
Walter Roberson
2021 年 8 月 7 日
(((u(1))–(cax*(u(2))*(u(2)))–(jr*(u(5))*(u(3)))–((iz-iy)*(u(3))*(u(4))))/(ix))
That code is using unicode U+2013 "EN DASH" instead of U+002D "hyphen-minus" which is the - character
4 件のコメント
Walter Roberson
2021 年 8 月 7 日
S = '(((cos(u(2))*cos(u(4))*sin(u(3)))+(sin(u(2))*(sin(u(4)))*(u(1)))-(cdx*(u(5))))/(m)'
% 123 4 5 43 4 5 43 4 5 432 3 4 5 43 4 5 6 543 4 5 432 3 4 5 4321 2 1
sum(S == '(')
sum(S == ')')
21 open brackets, 20 closing brackets.
The numbers above are the number of bracket levels in effect "after" the character above has been executed. You can see that you get back to 1, but you should be getting back to 0 instead.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!