Reading and processing multiple rows from Excel

9 ビュー (過去 30 日間)
Suzanne Harley
Suzanne Harley 2015 年 1 月 28 日
回答済み: oliver 2018 年 9 月 26 日
I have two spreadsheets with about 9000 rows of data each. I'm trying to take the data from the same row in each spreadsheet and process it like so:
A = xlsread('Book1.xlsx', 'A1:I1')
B = xlsread('Book2.xlsx', 'A1:I1')
pval=ranksum(A,B)
How can I make a loop that increases the row number each time it runs? Or is there a better method for such a large sheet?
  2 件のコメント
kmla
kmla 2018 年 9 月 25 日
are you find a solution? I have the same problem
Adam Danz
Adam Danz 2018 年 9 月 25 日

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

回答 (1 件)

oliver
oliver 2018 年 9 月 26 日
You do a simple loop like so:
for i=1:n %n should contain the number of lines you want to run through
ln=num2str(i); % string of current line
A=xlsread('Book1.xlsx', ['A',ln,':I',ln])
B=xlsread('Book2.xlsx', ['A',ln,':I',ln])
pval=ranksum(A,B)
end

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by