if clause for a nonscalar operator
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
shirin mhd
il 2 Ago 2022
Commentato: Abderrahim. B
il 2 Ago 2022
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 Commenti
Risposta accettata
Abderrahim. B
il 2 Ago 2022
If I understood correctly:
p=[];
if ~isscalar(p)
disp('hello')
else
disp('bye')
end
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Structures in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!