Hello, I have a doubt on this code:
x = []
if x == []
a=3
else
a=4
end
I don't understand why it always returns a = 4, even if x is an empty vector. How shall I modify it to obtain a right condition on x ? Thanks

 채택된 답변

Robert Cumming
Robert Cumming 2014년 8월 21일

0 개 추천

help isempty

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

질문:

2014년 8월 21일

댓글:

2014년 8월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by