exchange data between script and model

조회 수: 1 (최근 30일)
Khaled Abojlala
Khaled Abojlala 2016년 9월 29일
댓글: Walter Roberson 2016년 9월 29일
I am trying to send data from script to model and get the output data of the simulink model on the script to apply some calculations on them. I tried to use sim command, but it takes long time to run and cause out of memory to my script.
Is there any suggestions on other method that I can use?
  댓글 수: 5
Khaled Abojlala
Khaled Abojlala 2016년 9월 29일
four parameters with time step 10e-4 for time duration 4 sec. can I send prameter value using sim command or not?
Walter Roberson
Walter Roberson 2016년 9월 29일
You can set_param() and then sim()

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

채택된 답변

Walter Roberson
Walter Roberson 2016년 9월 29일
You might be able to use "MAT file logging"; see https://www.mathworks.com/help/rtw/ref/mat-file-logging.html
The To Workspace block only sends data at the time the simulation stops or is paused. In the past I have seen tricks for pausing the simulation and automatically restarting. See https://www.mathworks.com/matlabcentral/answers/80934-systematically-pause-simulink-model-and-continue-from-matlab-command-line#answer_90648

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by