MATLAB: Relational operations problems (real and imag parts)

imagMATLABreal

Hello all!
I want to replace this line
if imag(LAMBD(m,m)) ~= 0
into
if imag(LAMBD(m,m)) == 0
because the operation "~=" (even without imag()) is testing the imaginary part of LAMBD, but it doesn't work.
I have no idea why…
Thanks,
Kate

Best Answer

It seems that in this case "~=" doesn't mean testing the imginary part of LAMBD. if f(x) ~= 0 menas that f(x) is close to zero...