I solved my problem setting the simscape variables at Run-time variables, in this way when the parameters of a Simscape block are changed there is no need to regenerate the C code therefore the deployment of the app will succeed.
setVariable in simscape model through SimulationInput object( MATLAB web app server)
3 ビュー (過去 30 日間)
古いコメントを表示
Mauricio Rafael Calderon
2020 年 10 月 31 日
回答済み: Mauricio Rafael Calderon
2020 年 11 月 2 日
Hi everyone,
I am trying to set the value of a parameter that stays inside of a simscape block, using a web app aplication that was deployed on the server using MATLAB web app server.
The documentation says that the following Simulink functions and classes are deployable:
Functions:
Classes:
- Simulink.SimulationInput and its method setVariable
- Simulink.SimulationOutput
- Simulink.SimulationData.Dataset
I am using setVariable which allow me to set variables for a simulation through SimulationInput object.
SimInp = SimInp.setVariable('Tetha',app.tethaSpinner.Value);
In this way, I can modify certain parameters of the model but when the parameter is inside a Simscape block (elecrical , multibody, etc...) I am not able to modify the parameter anymore.
This problem only happens when I have to configure the application for deployment on the server using:
SimInput=Simulink.SimulationInput('SpringDamper');
SimInput=simulink.compiler.configureForDeployment(SimInput)
So, I was wondering if the problem is that the method SetVariable does not works with Simscape's blocks but only with Simulink Classic blocks.
Any suggestion would be great
Thank you
0 件のコメント
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Model Statistics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!