How to create a matlab script of an already created .slx file?

5 visualizaciones (últimos 30 días)
Nayla
Nayla el 21 de Nov. de 2022
Respondida: Walter Roberson el 23 de Nov. de 2022
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.

Respuestas (2)

Steve Miller
Steve Miller el 23 de Nov. de 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.
--Steve
  6 comentarios
Steve Miller
Steve Miller el 23 de Nov. de 2022
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.
Nayla
Nayla el 23 de Nov. de 2022
alright, i will try them out. Thanks for the help :)

Iniciar sesión para comentar.


Walter Roberson
Walter Roberson el 23 de Nov. de 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".

Categorías

Más información sobre Simscape Multibody en Help Center y File Exchange.

Productos


Versión

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by