Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: What is the best way to import Excel
Date: Fri, 27 Apr 2012 18:47:07 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 24
Message-ID: <jnepjb$nit$1@newscl01ah.mathworks.com>
References: <jnc9v7$1ot$1@newscl01ah.mathworks.com> <jnd2u6$95n$1@newscl01ah.mathworks.com> <jne71p$sfl$1@newscl01ah.mathworks.com> <jne9fm$aai$1@newscl01ah.mathworks.com> <jnejfk$pba$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
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 1335552427 24157 172.30.248.46 (27 Apr 2012 18:47:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 27 Apr 2012 18:47:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2921053
Xref: news.mathworks.com comp.soft-sys.matlab:766167

Peter Perkins <Peter.Remove.Perkins.This@mathworks.com> wrote in message <jnejfk$pba$1@newscl01ah.mathworks.com>...
> On 4/27/2012 10:12 AM, Ryan wrote:
> > I just tried this:
> > [a,b] = xlsread('stock_data.xls');
> > plot(datenum(stocks.Dates),stocks.MSFT,'o');
> > datetick('x',1,'keepticks');
> >
> > The code pretty much makes sense, but generates this error:
> > ??? Undefined function or variable 'stocks'.
> 
> Right, you haven't created a variable called stocks.  The code I 
> suggested presumed you had executed the code from my earlier post, i.e.,
> 
> stocks = dataset('XLSFile','stock_data.xls');
> 
> That line creates what's called a dataset array.  The rest of the code 
> demonstrated a few things:  selecting a subset from a dataset array, 
> creating a new dataset variable based on existing ones, plotting two 
> dataset variables, computing statistics on groups in the data.  The 
> documentation for the Statistics Toolbox has all of this in the User Guide.

That works!!  Thanks so much, Peter!  I'm going to have to look at the documentation for the Statistics Toolbox.  That's the only way I'm going to learn this stuff.

Regards.