global variable in a S-function
4 ビュー (過去 30 日間)
古いコメントを表示
Hi everyone
I'm simulating an partial differential equation (PDE) using the S-function block. When i use numbers in the mask parameters the model work well, but I want to use a global variable from other file to put in the mask parameters and occurs an error. I saw that I can only put numbers in the mask parameters, but I have a time variant parameter. How I can put an value from workspace or a variable with a number in the mask parameter from s-function?
best regards,
Gustavo
0 件のコメント
回答 (2 件)
Kaustubha Govind
2012 年 4 月 25 日
From your description, this seems like the supported workflow. Please specify the error message that you see? Also, please ensure that if you want to tune that parameter (ie, it is time-variant), please ensure that your S-function declares the parameter as tunable using ssSetSFcnParamTunable.
One other thing is that you need to run Ctrl+D or set_param(model, 'SimulationCommand', 'update') every time tunable parameters change in the workspace in order for Simulink to pick up the new value.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Block and Blockset Authoring についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!