Import simulink block model to workspace

조회 수: 1 (최근 30일)
Muhammad Asad
Muhammad Asad 2022년 4월 22일
댓글: Muhammad Asad 2022년 4월 23일
I have a coding in workspace and a simulink block model seperately.
During normal routinue: i firstly run initial workspace files and then open simulink block model and run. simulink block model variables get its value from work space.
Now i want to run directly simulink block model into workspace by using any matlab command.
for example
I write coding and run it. workspace coding run until its middle then it need a value of output varible (present in simulink block model). but this value generate after complete excecution of block model. so i want a command that automatically run this model and get result in workspace.
I try to use command "load *( model name)" but not working.
Can anyone give its answer using its expertees. thanks in advance. regards

답변 (1개)

Walter Roberson
Walter Roberson 2022년 4월 23일
Simulink variables are not available to MATLAB until the model is paused or stopped.
  댓글 수: 1
Muhammad Asad
Muhammad Asad 2022년 4월 23일
Thanks for your response.
In actuall, I want to vary two parameters in simulink block model. These values are vary in workspace using for loop. But once a new value assigned, it need complete simulation and get a result. I means if in for loop variables get a value then after a complete simulation it generate a output. that output stored in a table in workspace. After that an incremental value assigned to above variables they again run simulink block model and get a output.
I need a commmand that get fixed values of variables from workspace, simulate and in return give a result. Then again get a new value and after complete simulation give output as a result. This processed untill for loop stoped to assigned new values or for loop finished. At the end i have a table of output values.
I hope you better understand my idea. I also hope you give a good advice with your expertise. thanks in advance.

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

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by