|
"Jason Mickey" <jmick175@gmail.com> wrote in message <hcb1qm$958$1@fred.mathworks.com>...
> Why is my if statement being skipped? (The test if t==2 fails, even though the final value of t is 2). I have in a while loop
>
> if (t==2.0000) || (t==0.2) || (t==0.8) || (t==1.0) || (t==2.0)
> figure
> contour(X,Y,Tnew);
> end
>
>
> Also, is there a way to title my figure with the value of t encoded in it? I tried
>
> title('t = %1.3f',t)
>
> But that didn't work.
>
>
> Thanks.
Hi Jason
numbers are not exact for reason of binarisation, they might have a small deviation so try
abs(t-2.0) < alloweddeviation
instead of
t==2.0
hth
kinor
|