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

4 次查看(过去 30 天)
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

回答(1 个)

Sarthak
Sarthak 2023-3-24
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.

类别

Help CenterFile Exchange 中查找有关 Programmatic Model Editing 的更多信息

标签

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by