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

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.

답변 (2개)

Steve Miller
Steve Miller 2022년 11월 23일

0 개 추천

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

Thanks for the response.
Is there also a way to convert a simscape mutibody model file to a matlab script ?
Why do you want a MATLAB script instead of a .slx file?
i have a multibody model with function blocks for which i would like to have a look into their outputs. Thought that via the command windows it's easier to get them.
and with the matlab script i was so far able to view the functions' outputs and would like to try it out with simcape multibody.
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.
alright, i will try them out. Thanks for the help :)

댓글을 달려면 로그인하십시오.

Walter Roberson
Walter Roberson 2022년 11월 23일

0 개 추천

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".

카테고리

도움말 센터File Exchange에서 Simscape Multibody에 대해 자세히 알아보기

제품

릴리스

R2022b

질문:

2022년 11월 21일

답변:

2022년 11월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by