Syntax error , Component: Simulink, Category: Block error
14 ビュー (過去 30 日間)
古いコメントを表示
I am trying to create user defined function theta_2dot of inverted pedulum (cart and pole) using following formulas which is giving me syntax error
Formulas are : -(l*m*cos(u(3))*sin(u(3))*u(4)^2 + F*cos(u(3)) - g*m*sin(u(3)) - M*g*sin(u(3)))/(l*(M + m - m*cos(u(3))^2))
I would like to know correct format for above formulas.



Thank you, Aaron
0 件のコメント
回答 (1 件)
Walter Roberson
2024 年 8 月 25 日
編集済み: Walter Roberson
2024 年 8 月 25 日
Are you trying to use an Interpreted MATLAB Function block ? I think the formula is too complex for an Interpreted MATLAB block, and should be converted to a MATLAB Function block, or modeled with a whole series of Math blocks.
For one thing, I don't think Interpret MATLAB Function block recognizes variables (other than u). It just might possibly recognize variables that have been assigned in the base workspace... I'm not sure.
Note that these days, Interpreted MATLAB Function blocks are recommended against, and will be removed from some later MATLAB release (probably R2025a)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Simulink Functions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!