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$>
References: <jnc9v7$1ot$> <jnd2u6$95n$> <jne71p$sfl$> <jne9fm$aai$> <jnejfk$pba$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1335552427 24157 (27 Apr 2012 18:47:07 GMT)
NNTP-Posting-Date: Fri, 27 Apr 2012 18:47:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2921053
Xref: comp.soft-sys.matlab:766167

Peter Perkins <> wrote in message <jnejfk$pba$>...
> 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.