if clause for a nonscalar operator
4 ビュー (過去 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!