sim command says there are syntax errors in the MDL, but running MDL within Simulink works

5 views (last 30 days)
Hi,
I have a working MDL file that compiles and runs within Simulink, but when I call the model using the sim command I am recieving the following error:-
Error using runFAST
Error due to multiple causes.
Caused by:
Error using runFAST
The expression: u(strmatch('Azimuth',OutList))
in 'ROSCO/Cyclic Pitch controller/extract Azimuth'
has a syntax error
Error using runFAST
The expression: u(strmatch('BldPitch1',OutList))
in 'ROSCO/Extract Signals/Extract BldPitch1'
has a syntax error
The offending block is of type Fcn. I tried commenting out those blocks, but the same error arrives referencing a different (similar) block.
Why would the MDL work in simulink, but not with the sim command?
Matlab version is 2022b and OS is Windows 10 64 bit
Thanks,
Sahil

Answers (1)

Sarthak
Sarthak on 24 Mar 2023
Hi Sahil,
As per my understanding, it is difficult to find the accurate reason for your error without the model in which the error is occurring. However, there may be a few reasons you are getting errors.
  • One likely reason could be that Simulink model is using such variables or functions that are not defined in the MATLAB workspace. When you run a model in Simulink it automatically generates the required variables, however that is not the case with the sim command.
  • It is also possible there are missing or incorrect model parameters or input data or a version mismatch between the MATLAB version and the Simulink version you are using.
If the issue persists after verifying the reasons mentioned above, share your model, or raise a service request for it.

Categories

Find more on Programmatic Model Editing in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!