Thread Subject: Beginners trouble reading .xls file

Subject: Beginners trouble reading .xls file

From: DoVile Last Name:

Date: 3 Feb, 2012 22:58:18

Message: 1 of 6

I am simply trying to read a .xls file into matlab using the xlsread function, and do some basic plotting etc. however it cant "see" the first column of data which are the dates.


What can i be doing wrong ?


Thanks

Subject: Beginners trouble reading .xls file

From: Image Analyst

Date: 4 Feb, 2012 02:38:26

Message: 2 of 6

DoVile Last Name:
Did you get all three output arguments of xlsread()? Did you look at each of them?

Subject: Beginners trouble reading .xls file

From: DoVile Last Name:

Date: 4 Feb, 2012 07:32:29

Message: 3 of 6

"Image Analyst" wrote in message <jgi5n2$pp5$1@newscl01ah.mathworks.com>...
> DoVile Last Name:
> Did you get all three output arguments of xlsread()? Did you look at each of them?


I used all three:
filename = 'Matlab Programs\EF_data1.xls';
sheetname = 'Data';
range = 'A1:E377';
data = xlsread(filename);

Subject: Beginners trouble reading .xls file

From: DoVile Last Name:

Date: 4 Feb, 2012 08:16:10

Message: 4 of 6

"DoVile Last Name:" wrote in message <jgimud$e9c$1@newscl01ah.mathworks.com>...
> "Image Analyst" wrote in message <jgi5n2$pp5$1@newscl01ah.mathworks.com>...
> > DoVile Last Name:
> > Did you get all three output arguments of xlsread()? Did you look at each of them?
>
>
> I used all three:
> filename = 'Matlab Programs\EF_data1.xls';
> sheetname = 'Data';
> range = 'A1:E377';
> data = xlsread(filename);



I meant to write:

I used all three
filename = 'Matlab Programs\EF_data1.xls';
sheetname = 'Data';
range = 'A1:E377';
data = xlsread(filename,sheetname,range);

Subject: Beginners trouble reading .xls file

From: Steven_Lord

Date: 6 Feb, 2012 14:54:20

Message: 5 of 6



"DoVile Last Name:" <thedreamshaper@gmail.com> wrote in message
news:jgipga$lbb$1@newscl01ah.mathworks.com...
> "DoVile Last Name:" wrote in message
> <jgimud$e9c$1@newscl01ah.mathworks.com>...
>> "Image Analyst" wrote in message
>> <jgi5n2$pp5$1@newscl01ah.mathworks.com>...
>> > DoVile Last Name:
>> > Did you get all three output arguments of xlsread()? Did you look at
>> > each of them?
>>
>>
>> I used all three:
>> filename = 'Matlab Programs\EF_data1.xls'; sheetname = 'Data';
>> range = 'A1:E377';
>> data = xlsread(filename);
>
>
>
> I meant to write:
>
> I used all three
> filename = 'Matlab Programs\EF_data1.xls'; sheetname = 'Data';
> range = 'A1:E377';
> data = xlsread(filename,sheetname,range);

That's not what Image Analyst suggested.

http://www.mathworks.com/help/techdoc/ref/xlsread.html

"[num,txt,raw] = xlsread(filename) reads data from the first worksheet in
the Microsoft Excel spreadsheet file named filename and returns the numeric
data in array num. Optionally, returns the text fields in cell array txt,
and the unprocessed data (numbers and text) in cell array raw."

Call XLSREAD with three OUTPUT arguments (and your three input arguments)
and look at all three of them. Two of them should contain the information
you're looking for.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: Beginners trouble reading .xls file

From: ImageAnalyst

Date: 4 Feb, 2012 14:21:27

Message: 6 of 6

On Feb 4, 3:16 am, "DoVile Last Name:" <thedreamsha...@gmail.com>
wrote:
> data = xlsread(filename,sheetname,range);
--------------------------------------------------------------------------------------

NO. Those are INPUT arguments. Look at the help for xlsread and look
at the very first way it says to use it:

[num,txt,raw] = xlsread(filename)

Did you do it that way? No you didn't. Try it like it suggests:
[data textCells, rawCells] = xlsread(filename,sheetname,range);
and see what's in all of the output arguments it returns.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
excel DoVile Last Name: 3 Feb, 2012 17:59:30
xls DoVile Last Name: 3 Feb, 2012 17:59:30
rssFeed for this Thread

Contact us at files@mathworks.com