XLSREAD: make rows and columns flexible/dynamic?

Hi, I would like to read several excel files, but their format differs. Each should start at the same cell (d5) and read until NaN fields (in rows and columns). My code so far is:
n=100;
for i=1:n;
range=sprintf('A%d',i);
USE=xlsread('X:\xx.xlsx','aa');
if USE(i,1)==[NaN];
break;
end;
end;
result=i-1;
How can I add a flexible column and how can I make it to start reading at the 5th row/4th column of the file instead of the first? Thank you!

1 件のコメント

dpb
dpb 2015 年 2 月 12 日
編集済み: dpb 2015 年 2 月 12 日
Probably simpler is to just read the full file and then select the data subset(s) desired (or, conversely set the unwanted region(s) to []).
Using xlsread in a loop this way will be quite slow, btw.

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLarge Files and Big Data についてさらに検索

タグ

質問済み:

2015 年 2 月 12 日

編集済み:

dpb
2015 年 2 月 12 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by