if clause for a nonscalar operator
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
shirin mhd
le 2 Août 2022
Commenté : Abderrahim. B
le 2 Août 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 commentaires
Réponse acceptée
Abderrahim. B
le 2 Août 2022
If I understood correctly:
p=[];
if ~isscalar(p)
disp('hello')
else
disp('bye')
end
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Solver Outputs and Iterative Display dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!