필터 지우기
필터 지우기

How to stop simulation until the workspace data end?

조회 수: 6 (최근 30일)
sewook
sewook 2012년 6월 14일
There is a input from workspace. (this block be can found in Sources categories. ) Whenever I simulate a block, I should change the simulation time at the top of the diagram. (just side by stop button.)
My question is, How can I stop simulation when the input are finished? (the input has 2 columns - time, value)
ex:)
the input like below:
time, value
0, 35
1, 20
2, -10
... ...
10, 5
I would like to stop my diagram at 10sec.

채택된 답변

TAB
TAB 2012년 6월 14일
There are two ways....
(1) Set the stop time of your model using time value as
set_param('YourModel', 'StopTime', num2str(WSData.time(end)));
then simulate your model.
(2) Simulate your model directly using sim() command by providing stop time as parameter.
sim('YourModel', WSData.time(end));
  댓글 수: 3
TAB
TAB 2012년 6월 14일
Ok, I assumed that your workspace data is in the format of "Structure with time".
sewook
sewook 2012년 6월 14일
Wow, not only your answer but also your comment are real time~! :-)
Your advice is very helpful for my model. thank you again~

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

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by