Reading and processing multiple rows from Excel
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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?
Antworten (1)
oliver
am 26 Sep. 2018
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
0 Kommentare
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!