Relational operations problems (real and imag parts)

1 view (last 30 days)
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
  1 Comment
Matt J
Matt J on 25 Nov 2012
I'm skeptical that it doesn't work. And you haven't provided any illustration to prove it...

Sign in to comment.

Accepted Answer

Ekaterina
Ekaterina on 25 Nov 2012
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...

More Answers (2)

Azzi Abdelmalek
Azzi Abdelmalek on 25 Nov 2012
Maybe it's about numerical problems, for example try this
0.3-0.2==0.4-0.3
%you will find 0

Ekaterina
Ekaterina on 25 Nov 2012
It would be difficult as I have 600 lines of code.
  1 Comment
Matt J
Matt J on 25 Nov 2012
Edited: Matt J on 25 Nov 2012
Yes, and we wouldn't be interested in seeing all 600 lines of your code. However, only a small number of those lines are actually causing trouble. Therefore, it should be easy for you to construct a separate, small, simplified example based on those lines.

Sign in to comment.

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!