How to create a matlab script of an already created .slx file?
5 次查看(过去 30 天)
显示 更早的评论
Hi there,
i created a simscape multibody model with additional blocks and would like to have the corresponding file as a script. With that script i would like to set parameters or variables to ease its analysis and the parametrization.
How can I achieve that?
Thanks in advance.
0 个评论
回答(2 个)
Steve Miller
2022-11-23
The MATLAB command set_param() will allow you to set the parameter of nearly any Simulink, Simscape, or Simscape Multibody block.
This submission shows you how to use MATLAB commands to add blocks, lines, set parameters, run simulations, and post-process results.
https://www.mathworks.com/matlabcentral/fileexchange/45410-simscape-multibody-model-from-matlab-code
--Steve
6 个评论
Steve Miller
2022-11-23
If you have integrated your MATLAB blocks into the Simulink model where the Simscape Multibody blocks are, you can use general Simulink logging/scopes/etc. to check your outputs. Pulling it all into a MATLAB script is not the way to go.
Walter Roberson
2022-11-23
No, there is no way to convert a Simulink or Simscape or Stateflow model to the corresponding MATLAB code. And if there were then the result would no longer be "blocks".
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simscape Multibody 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!