The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: How to Select Entire Row From Excel File Uisng Prompt?
Replies: 11   Last Post: Nov 23, 2012 5:52 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Phil Goddard

Posts: 358
Registered: 1/27/12
Re: How to Select Entire Row From Excel File Uisng Prompt?
Posted: Nov 18, 2012 1:22 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

You could spend time digging into the file to see how many columns of the specified row are actually used and then just extract those cells, but it may be just as quick to use a sledge hammer approach

% Reading 2007 and 2010 files
row = xlsread('myfile.xls',sprintf('A%d:XFD%d',rowNumber));
catch ME %#ok
% read 2003 files
row = xlsread('myfile.xls',sprintf('A%d:IV%d',rowNumber));
catch ME

% Strip nans from the result
% (This will strip all nans not just those at the end of the row.)
data = row(~isnan(row));


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.