Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Create a range from a given cell using xlsread

조회 수: 2 (최근 30일)
Jason
Jason 2015년 4월 10일
마감: MATLAB Answer Bot 2021년 8월 20일
Is it possible to search for a given string in a column A of an excel sheet, then obtain the number in the same row, but in column B and then to use this number as the last value in a range:
i.e. if the number in the cell adjacent to where "Count" is is 15000, the perform:
[ndata, text]=xlsread(file,'A1:A15000');
Thanks Jason

답변 (1개)

Jason
Jason 2015년 4월 10일
I think I've worked out the solution:
[~,~,rawData] = xlsread(file,'A1:A50')
dummy='Count';
idx=find(strcmp(rawData(:),dummy),1)
ct=sprintf('B%d:B%d',idx,idx)
[count, ~]=xlsread(file,ct)
  댓글 수: 1
Jason
Jason 2015년 4월 10일
My excel file is saved as a CSV, is xlsread the quickest way to read in the data as there are 800k lines?
Thanks

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by