How to use Switch case and if else in Embedded Matlab Function
조회 수: 1 (최근 30일)
이전 댓글 표시
I am trying to put an ifelse condition under switch statements in Embedded Matlab Function. Can anyone suggest me the correct way of syntax used in Embedded Matlab Function.
Thanks in Advance.
댓글 수: 0
답변 (1개)
Laura Proctor
2012년 12월 24일
댓글 수: 2
Walter Roberson
2012년 12월 26일
Initialize the output before you enter the switch().
Currently, one of the choices you have in the switch does not always assign a value to the output. For example, if you had
if length(A) > 5
B = A + 1;
else
warn('A is too short');
end
then that code does not assign a value to B in the case of the warning.
참고 항목
카테고리
Help Center 및 File Exchange에서 Install Products에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!