How to exit a function execution in MATLAB Function block in simulink?
조회 수: 53 (최근 30일)
이전 댓글 표시
Bhargava Reddy Banala
2017년 12월 4일
댓글: Bhargava Reddy Banala
2017년 12월 4일
I have simulating the miller-L code in simulink using MATLAB function block. If the program is run for the first time, I want the output to be like this:
if isempty(flag)
flag=1;
con = initial*-1;
h1 = BinaryInput;
if BinaryInput == 1
MillerSignal = [con*ones(1,1) -con*ones(1,1)];
con=con*-1;
else
MillerSignal = [-con*ones(1,2)];
con = con*-1;
end
return;
end
I am not sure whether the return statement is returning out of the function or just from the function block. Is this correct? If not, what is the correct way to do it?
댓글 수: 0
채택된 답변
Walter Roberson
2017년 12월 4일
편집: Walter Roberson
2017년 12월 4일
The return would exit the function for that one call. If the internal code for MATLAB Function Block has anything more to execute then it would do so.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 General Applications에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!