Path: news.mathworks.com!not-for-mail
From: "Ender " <jr147@msstate.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Undefined function or method
Date: Thu, 9 Jun 2011 19:59:04 +0000 (UTC)
Organization: Mississippi State University
Lines: 51
Message-ID: <isr8m8$82e$1@newscl01ah.mathworks.com>
References: <isr83g$60u$1@newscl01ah.mathworks.com> <isr87s$6l0$1@newscl01ah.mathworks.com>
Reply-To: "Ender " <jr147@msstate.edu>
NNTP-Posting-Host: www-01-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1307649544 8270 172.30.248.46 (9 Jun 2011 19:59:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 9 Jun 2011 19:59:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1035766
Xref: news.mathworks.com comp.soft-sys.matlab:731149

"Steven_Lord" <slord@mathworks.com> wrote in message <isr87s$6l0$1@newscl01ah.mathworks.com>...
> 
> 
> "Ender " <jr147@msstate.edu> wrote in message 
> news:isr83g$60u$1@newscl01ah.mathworks.com...
> > I am trying to take data that has a time, and date associated with each 
> > data point. I would like to put this data into an array which has 
> > "[Pressure, Time, Date]
> >
> > I have a bunch of data points > 10. However I am starting out with just 2 
> > so that I can get some of the bugs out. However this particular bug does 
> > not make much sense to me. I get this error,"Undefined function or method 
> > 'Press' for input arguments of type 'double'.
> > " I am not sure why I am getting this error. My logic seems correct, and I 
> > don't think I misspelled anything. However, this error is here. Here is an 
> > example of my code:
> >
> > % Pressure at date and time
> >    % Sample 1
> >        [y, m, d, h, mn,] = datevec('June 07, 2011  11:53:00 AM');
> >        date1 = sprintf('Date: %d/%d/%d   Time: %d:%d%f\n', m, d, y, h, mn) 
> > % Month, Day, Year, Hour, Minute
> >        Press1 = 6.00e-5;  % Torr
> 
> Do NOT name your variables like Press1, Press2, etc. See the question about 
> creating A1, A2, etc. in the newsgroup FAQ for some of the reasons you 
> should not do this and alternatives.
> 
> >    % Sample 2
> >        [y, m, d, h, mn,] = datevec('June 07, 2011  1:45:00 PM');
> >        date2 = sprintf('Date: %d/%d/%d   Time: %d:%d%f\n', m, d, y, h, mn) 
> > % Month, Day, Year, Hour, Minute
> >        Press2 = 2.06e-5;  % Torr
> >
> >        % Store date into an array
> >    for i = 1:2
> > %         date_6_7_11(i) = [date(i)];
> >        Press_6_7_11 = [Press(i)];
> 
> You do not have any function or array named Press, so Press(i) correctly 
> errors.
> 
> -- 
> Steve Lord
> slord@mathworks.com
> To contact Technical Support use the Contact Us link on 
> http://www.mathworks.com 

Please explain. How have I used the index incorrectly? Instead of using the current array to store all of my Press data should I have first put all of my Press data into an array by itself then create and array with Press and date?

--Ender--