lundi 24 juillet 2017

How to use if condition on a variable in MATLAB?

Hi I am a newbie in MATLAB.

I have a variable named predictLabels which has values i.e 1,2,3,4. For each image the value of predictLabels changes. In workspace it shows as predictLabels = '1' etc.

Problem is, when i use if condition to that variable nothing hapens. Partial code given below-

if predictLabels == 1
    imshow(img);
end

The above code is not working. No error showing, even compiler is not entering in if statement. I think there is a function for this kind of condition check.

Aucun commentaire:

Enregistrer un commentaire