필터 지우기
필터 지우기

Refer to Simulation time in Simulink

조회 수: 4 (최근 30일)
Sheetansh Kaushik
Sheetansh Kaushik 2013년 6월 19일
Morning!
I have created a model which gives the output after a certain part of simlation time has elapsed. i.e. Consider the following example:
<Subsystem_1> --> If Simulation time == x, then provide output of Subsystem 1 to --> <Subsystem_2>.
So, Subsystem_1 runs with respect to simulation time and the Subsystem_2 only gets the output from Subsystem_1 once Simulation time has elpased x-units.
Now, i have done the same using If-Else Block(along with the action susbsystem).
Question: Hints or Command ,which does the same without explicitly specifying with a If-Else block?
Subsystem_1 = Pulse Generator + Counter
Subsystem_2 = Matlab Embedded Function + Simout
So, just to regress: A command which i can include in the Embedded Function.
Thanks for your consideration!
  댓글 수: 3
Sheetansh Kaushik
Sheetansh Kaushik 2013년 6월 20일
편집: Sheetansh Kaushik 2013년 6월 20일
Ryan G: Thanks for your answer and sorry for the super late reply. Actually, i cant upload a pic coz i cant access any Image-Sharing websites. But i humor me :
-Block 1- -Block 2- -Block3- -Block4-
Pulse Generator -> Counter -> Embedded matlab FCN -> Display
So my intention is: If the simulation time is set to 51,then Wait until counter has finished counting untill say Simulation Time-50, and in the next 1 unit of simulation time to calculate the FCN. I have already checked with -tic,toc- the time is enough. So, i hope this whole setup give you a better idea! Thanks again for your patience!
Ryan G
Ryan G 2013년 6월 20일
I guess the difference between simulation time and clock time can be a bit confusing to discuss via internet. If you mean sim time, you can use a clock or digital clock block to do this. If you mean clock time, tic toc may be valid, but I don't think you should use clock time at all.
What you can do is put -Block3- inside of an enabled subsystem. Connect the clock block (this is in the Simulink library) to a comparison, 50 in this example. Connect the output of that to the enabled port of the enabled subsystem. That should do it.

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

답변 (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