Reading and processing multiple rows from Excel
Afficher commentaires plus anciens
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?
Réponses (1)
oliver
le 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
Catégories
En savoir plus sur Spreadsheets dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!