change the simulation stop time from a block

조회 수: 4 (최근 30일)
Golden
Golden 2020년 4월 7일
댓글: Ameer Hamza 2020년 4월 9일
I understand you may change the simulation stop time using set-param function. However, I'd like to do the same thing with a block. This way I can make it to a library so that people just take it from library and drop to his/her model. I need to be able to change the stop time which is calcuated by this block. Thanks.

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 4월 7일
You can stop the simulation at any using stop block: https://www.mathworks.com/help/simulink/slref/stopsimulation.html. You can define a condition, and when the condition becomes true, the simulation stops. Note, this method will only allow decreasing the simulation time. If you want to run the simulation, longer than the stop-time, I am not sure whether it is possible.
  댓글 수: 16
Golden
Golden 2020년 4월 8일
great. it works. thanks a lot.
Ameer Hamza
Ameer Hamza 2020년 4월 9일
I am Glad to be of help.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by