Path: news.mathworks.com!not-for-mail
From: "jeremy " <rower15@excite.com>
Newsgroups: comp.soft-sys.matlab
Subject: Question on IF statements, I think...
Date: Wed, 23 Jul 2008 18:50:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 22
Message-ID: <g67ugs$6bl$1@fred.mathworks.com>
Reply-To: "jeremy " <rower15@excite.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1216839004 6517 172.30.248.37 (23 Jul 2008 18:50:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 23 Jul 2008 18:50:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 180479
Xref: news.mathworks.com comp.soft-sys.matlab:481313



I've got the following code which is doing almost just what
I want it to do...  

   load HC_actual;
   New_measurement = input('Enter new x/y data pair: ');
   HC_Chart_actual(end+1,:) = New_measurement;
   save HC_actual

Now for the question...  How do I put the above code in my
M-file so that I can, from the command prompt, opt to enter
new data or just go on with the M-file without adding new
data to the HC_actual array?  

Basically, I want a Command Window prompt that asks "Do you
want to enter new data?" and depending on whether I type in
'y' or 'n', the program either does the above code or skips
the code and continues the routine.  

Any suggestions?  

Thanks!  Jeremy