Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Skipped if statements
Date: Thu, 29 Oct 2009 03:23:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 16
Message-ID: <hcb1qm$958$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1256786582 9384 172.30.248.35 (29 Oct 2009 03:23:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 29 Oct 2009 03:23:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2065659
Xref: news.mathworks.com comp.soft-sys.matlab:580829


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.