MATLAB: Error in subtracting

subtraction

I have a code
if Sparse_Conc_Index>=1
---------
---------
---------
Class_Image = (Image_Path);
figure,imshow(Class_Image)
else
msgbox('Invalid Image ','ALERT')
end
if i do
F=1-Sparse_Conc_Index
i get
F = 5.1341e-011
please tell how to get F as zero

Best Answer

If F = 1 - Sparse_Conc_Index is positive, then Sparse_Conc_Index >= 1 is false, so your "if" should not be true.
Your problem then reduces down to why Sparse_Conc_Index is not at least 1, which is something we do not know as you do not show how you calculated Sparse_Conc_Index .