How can I read in rows from an Excel spreadsheet using iteration?

I am working with a spreadsheet Is there a way I can read in one row at a time in a for loop? this is the code which i have filename='ht2.xls'; xlRange = 'A(i):H(i)'; mat=xlsread(filename,xlRange);
ie i want to input data from i'th row column A to H

2 Comments

because i need data specifically of that row for my program

Sign in to comment.

 Accepted Answer

filename='ht2.xls';
mat=xlsread(filename);
Then use the row you want mat(k,:)

3 Comments

The file is too big for that, it would take ages to read
Use
ii1=1;
ii2=10;
xlRange = sprintf('A%d:H%d',ii1,ii2)

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!