How to create a matlab script of an already created .slx file?
2 views (last 30 days)
Show older comments
Nayla on 21 Nov 2022
Answered: Walter Roberson on 23 Nov 2022
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.
Steve Miller on 23 Nov 2022
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.
Walter Roberson on 23 Nov 2022
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".
Find more on Troubleshooting in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!