필터 지우기
필터 지우기

Reading and processing multiple rows from Excel

조회 수: 2 (최근 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?

답변 (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 CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by