How to set StopTime programmatically?

조회 수: 1 (최근 30일)
Danijel Domazet
Danijel Domazet 2020년 5월 13일
편집: Fangjun Jiang 2020년 5월 13일
My model stop time is set to 5 seconds. I want to change that programmatically.
open_system(test_model, 'loadonly');
set_param(test_model, 'StopTime', '100')
% run simulation
sim('test');
% save modified model
save_system(test_model, 'modified_model')
When I run the simulation, it does not run for 100 seconds.
However, when I open modified_model I see in the GUI that Stop time is set to 100.
Why is the model running for 5 seconds only and GUI shows 100?

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2020년 5월 13일
편집: Fangjun Jiang 2020년 5월 13일
test_model and 'test' must have been two different models.

카테고리

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

태그

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by