if clause for a nonscalar operator
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
shirin mhd
el 2 de Ag. de 2022
Comentada: Abderrahim. B
el 2 de Ag. de 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 comentarios
Respuesta aceptada
Abderrahim. B
el 2 de Ag. de 2022
If I understood correctly:
p=[];
if ~isscalar(p)
disp('hello')
else
disp('bye')
end
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Structures en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!