필터 지우기
필터 지우기

excel data to matlab

조회 수: 2 (최근 30일)
zamri
zamri 2013년 1월 7일
Hi all,
Can i ask how to make matlab read data one by one from excel file for each loop.
Say
for num2 = 1:10
A=1+b;
end
for every num2, i want to take data from excel (A1:A10) for example.

채택된 답변

Walter Roberson
Walter Roberson 2013년 1월 7일
for num2 = 1 : 10
thiscell = sprintf('A%d:A%d', num2, num2);
A = xlsread('TheFile.xls', thiscell);
.... do something with A
end
Warning: this will be very inefficient!
  댓글 수: 3
zamri
zamri 2013년 1월 7일
편집: Image Analyst 2013년 1월 7일
great, thanks guys. I try the method from 'Image analyst'.
Image Analyst
Image Analyst 2013년 1월 7일
Be aware that num, texts, and raw do not all necessarily start at the same cell in Excel. They can start at different upper left corners. So num(3,3) could be cell D5, not C3, and texts(3,3) could be E6 and raw(3,3) could come from cell D5 (raw will be the upper left of the combined num and texts).

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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