if clause for a nonscalar operator
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi everyone
I have this code:
p=[];
if p==[]
disp('hello')
else
disp('bye')
end
and I expect this answer:
>> test
hello
but I receive this answer:
>> test
bye
how can i solve this problem???
댓글 수: 0
채택된 답변
Abderrahim. B
2022년 8월 2일
If I understood correctly:
p=[];
if ~isscalar(p)
disp('hello')
else
disp('bye')
end
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!