Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
From: TideMan <mulgor@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: =?windows-1252?Q?Re=3A_What_is_the_best_way_to_import_Excel_files=2C_with?=
	=?windows-1252?Q?_stock_data=2C_into_Matlab=3F_I=92m_using_Matlab_R2010b_=2864=2Dbit=29?=
Date: Thu, 26 Apr 2012 16:38:33 -0700 (PDT)
Organization: http://groups.google.com
Lines: 37
Message-ID: <10550607.643.1335483513669.JavaMail.geo-discussion-forums@pbbpz9>
References: <jnc9v7$1ot$1@newscl01ah.mathworks.com>
NNTP-Posting-Host: 202.78.152.105
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1335483514 3261 127.0.0.1 (26 Apr 2012 23:38:34 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 26 Apr 2012 23:38:34 +0000 (UTC)
Cc: Ryan <ryanshuell@gmail.com>
In-Reply-To: <jnc9v7$1ot$1@newscl01ah.mathworks.com>
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=202.78.152.105;
 posting-account=qPexFwkAAABOl8VUndE6Jm-9Z5z_fSpR
User-Agent: G2/1.0
Xref: news.mathworks.com comp.soft-sys.matlab:766076

On Friday, April 27, 2012 8:08:07 AM UTC+12, Ryan  wrote:
> What is the best way to import Excel files, with stock data, into Matlab? I’m using Matlab R2010b (64-bit)
> 
> I’m trying to import historical prices of stock data. Matlab keeps cutting off the header of each column; it gives me only values. I am thinking that this is a data-type-mixing-issue, or whatever it’s called.
> 
> I have ‘Dates’ in ColumnA, and ‘MSFT’, ‘PWER’, ‘KO’, and ‘SBUX’, in ColumnB-ColumnE.
> 
> Basically, if I put the Excel file in my Matlab folder and double-click the file, I see the values in a matrix (no dates and no headers), I hit ‘Next’. Then, I see only one option; one radio button is enabled – ‘Create variable matching preview’. The other two options, ‘Create vectors from each column using column names’ and ‘Create vectors from each row using row names’ – both are greyed out. I’ve seen videos, on YouTube and on the Matlab site, where people import excel data and these options are NOT greyed out. No matter what I do, there options are ALWAYS greyed out. The problem is, when I click ‘Finish’ in my ‘Workspace’ I have a variable named ‘data’ all values in a 575x4 matrix, but I have NO DATES and I have NO HEADERS on the columns. All of this seems to go into another variable, called ‘textdata’; all dates and headers ate in textdata. This is VERY inconvenient. I’m trying to 
> analyze some stock data and I have no headers, so I have no idea which stock is which (I can figure it out, but I think Matlab should do this for me). Also, I have no dates corresponding to the historical stock prices. This is VERY weird. How can I pull in test and values together? 
> 
> I have a sample file here:
> http://www.mediafire.com/view/?8k7ztoaaj82dqtj

Why not revert to the old-fashioned way:
[a,b]=xlsread(xlsfile);
will give the numerical data in a matrix a and everything else as a cell array in b.