Hi guys I am new with Simulink and igot a problem about switch block.
I want to pass a signal once it reaches a certain value and doesn't matter if it drops or exceeds further.
Let me give an example.
Let say i have two signals 'h' (altitude of an aircraft) and 'v' (speed of that air craft).
Let say i want to pass 'v' signal once my altitude reaches 10000 ft. It doesnt matter if my altitude drops or exceeds 10000ft after i reach 10000ft. Is there any way to do this ?

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 11월 11일
편집: Azzi Abdelmalek 2014년 11월 11일

0 개 추천

You can use Matlab function block with the code:
y=function(h,v)
persistent m
if isempty(m)
m=0
end
if h<=1000 & m==0
y=h
else
m=2000
y=v
end

댓글 수: 1

theShield
theShield 2014년 11월 12일
Thank you very much. This solves my problem.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Simulink에 대해 자세히 알아보기

제품

질문:

2014년 11월 11일

댓글:

2014년 11월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by