I'm working on counting numbers using if-else
statement. I'm getting the result, but it's only executing the else part and not looking at the other part.
This is the code I'm working with
i = 0;
j = 0;
if sum( abs( f1(:) - f2(:))) == 0.0
i = i + 1;
else
j = j + 1;
end
if sum(abs(f2(:) - f3(:))) == 0.0
i = i + 1;
else
j = j + 1;
end
if sum(abs(f3(:) - f4(:))) == 0.0
i = i + 1;
else
j = j + 1;
end
msgtext = sprintf('Matching = %d',i);
h = msgbox(msgtext);
msgtxt = sprintf(' Not Matching = %d',j);
h = msgbox(msgtxt);
Any suggestions?
Thanks in advance!