Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
If else statement problem
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MUHAMMAD NAZMI ZAINAL AZALI
am 13 Dez. 2019
Geschlossen: MATLAB Answer Bot
am 20 Aug. 2021
Hi, im having issues with if else statement which the value of 0 show failed.jpg. But it supposed to be show passed.jpg.
if (idx <= 4)
imshow('Passed.jpg')
else
imshow('Failed.jpg')
end
0 Kommentare
Antworten (1)
Guillaume
am 13 Dez. 2019
I would suspect that the reason you always get 'failed' is because your idx is not scalar, in which case you need to loop of each element of your idx array before testing them with your if.
If that's not the issue then give attach your m code and a mat file with the necessary input to run it.
0 Kommentare
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!