how to do xlsread if I don't know the number of rows on the Excel sheet?

  • Follow


Hi all,

Is there a good way of solving this problem?

I have an Excel book with quite a number of sheets, each sheet
contains one column of dates and many columns of data.

The book is dynamically growing.

Every time my Matlab program opens the book, it doesn't know the
number of rows. (it's supposed to work as a mid-night automation
process, so I won't be able to be there every mid-night to read the
number of rows and input it to the Matlab automation program.)

So how to solve this problem?

Currently since I am using Excel 2003, so I put the max number of rows
to be 65535, etc.

But then I have to do lots of post-processing to truncate the 65535
rows with many blank empty rows...

Any thoughts?

Thank you!
0
Reply Luna 9/23/2010 11:52:11 PM

Luna Moon <lunamoonmoon@gmail.com> wrote in message <9710e953-a64d-48c6-ad4d-f39ba0c2d0fa@c13g2000vbr.googlegroups.com>...
> Hi all,
> 
> Is there a good way of solving this problem?
> 
> I have an Excel book with quite a number of sheets, each sheet
> contains one column of dates and many columns of data.
> 
> The book is dynamically growing.
> 
> Every time my Matlab program opens the book, it doesn't know the
> number of rows. (it's supposed to work as a mid-night automation
> process, so I won't be able to be there every mid-night to read the
> number of rows and input it to the Matlab automation program.)
> 
> So how to solve this problem?
> 
> Currently since I am using Excel 2003, so I put the max number of rows
> to be 65535, etc.
> 
> But then I have to do lots of post-processing to truncate the 65535
> rows with many blank empty rows...
> 
> Any thoughts?
> 
> Thank you!

Why do you need to tell Matlab the number of rows?
Why not just

num = xlsread(filename, sheet);

Ross
0
Reply Ross 9/24/2010 1:43:05 AM


1 Replies
642 Views

(page loaded in 0.056 seconds)

Similiar Articles:













7/20/2012 9:12:34 PM


Reply: