syntax error on simulink

8 views (last 30 days)
Moopela Tlhone
Moopela Tlhone on 10 Jun 2021
Answered: Walter Roberson on 10 Jun 2021
I am getting an error in simulink in a Fcn block:
m*(u(1) - l*u(3)*u(3)*sin(u(2)) + l*u(4)*cos(u(2)))
Can someone help urgently. Thanks in advance.
  3 Comments
Jonas
Jonas on 10 Jun 2021
Can you urgently post the error message you are getting?
Moopela Tlhone
Moopela Tlhone on 10 Jun 2021
The expression: m*(u(1) - l*u(3)*u(3)*sin(u(2)) + l*u(4)*cos(u(2)))
in 'Model'
has a syntax error

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 10 Jun 2021
Simulink Fcn blocks give syntax errors if you name variables in them that are not variables that exist in the workspace.
I suspect that either m or I or both are not currently defined.
You might tend to think that Fcn blocks would wait until execution time to look for variables existing, but if I recall correctly, they parse the string at block initialization time

More Answers (0)

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!