Problem with name of simulink model slTuner
조회 수: 26 (최근 30일)
이전 댓글 표시
Dear forum members,
I would like to use slTuner to tune control gains of Simulink models.
The simulations are stored in "+slxFiles/model.slx".
The name of the model is stored in a variable :
mdlName = '+slxFiles/model.slx';
When I try to open the simulink file this way, everything works fine :
open(mdlName);
But the problem occurs when I call the slTuner function :
slTuner(mdlName,TunedBlocks);
Error using slLinearizer (line 193)
'+slxFiles' is not a valid model name because it is not a valid MATLAB function name.
Why does slTuner cut the name after the "/" ? How can I solve this issue ?
Thanks in advance !
댓글 수: 0
답변 (1개)
Guillaume
2023년 9월 14일
Hello,
Old issue but might help someone some day...
Speaking about file path '+slxFiles/model.slx' is correct.
But all functions that requires a model name (open_system, slbuild, get_param...) just want the model name, no path, no extension.
In order to open a Simulink model you should use open_system instead of open.
In your case, modelName = 'model'. And the model file has to be in the Matlab Path or in the pwd.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!