clc
tol = 10^-3 ;
display('code executing');
for number=1:0.1:15
if abs(number-13.2)<=tol
disp('Hello');
end
end
You should not compare flottant numbers using ==..you should subtract and check is the absolute value of difference is less then a specified tolerance.
Best Answer