How to stop a function? Simulink.

조회 수: 7 (최근 30일)
Ana
Ana 2012년 2월 15일
편집: sixwwwwww 2013년 10월 13일
Hello,
This is what I want to do, I am working on simulink, I have a function (M-file), I have one input, if this input is equal to "1" the M-file start and when the input change to "0", I want to stop this M-file (and reset all the values) until the input change again to 1 and start the excecution as the first time.
Some how the "IF" block of simulink only make the change but the M-file continue being executed.
I can not use the pause command because Its stop all the simulation And I only want to stop the execution of this M-file.
I hope u understand me, I wait for your help. Thanks.

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2012년 2월 15일
I think you need to out your M-file inside an Enabled Subsystem and use your input as the control signal for the subsystem, so that your M-file is executed only when the subsystem is enabled.
  댓글 수: 1
Ana
Ana 2012년 2월 15일
I Will try, Thanks!

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by