필터 지우기
필터 지우기

reading excel data, without knowing range

조회 수: 14 (최근 30일)
John
John 2011년 12월 16일
댓글: Walter Roberson 2020년 5월 4일
Hi,
I have a line of code that reads in files from excel for a specific range. However, I don't know the last row of data in every file. Could somebody advise me on how to read in the data without knowing the number of the last row of data in advance.
May thanks
sch_cycle=xlsread('C:\Autonomie drive cycles\NEDC.xlsx','Sheet1','A2:B20');

답변 (2개)

Ora Zyto
Ora Zyto 2011년 12월 16일
John, Does reading from the entire worksheet satisfy your requirements?
B = xlsread('myExample.xls', 'MySheet')

Aldin
Aldin 2011년 12월 16일
편집: Walter Roberson 2020년 5월 4일
[~,leng] = xlsread('NEDC.xls','Sheet1', 'A:A'); %column in array
l = length(leng); %length of column
length_string = num2str(l+1);
num = ['A',length_string]; % A1 or A2 or A3 it depends of length
xlswrite('NEDC.xls','Jhon','Sheet1',num);
That's my algorithm :)
  댓글 수: 2
Mohammed NACIRI
Mohammed NACIRI 2020년 5월 4일
편집: Mohammed NACIRI 2020년 5월 4일
Hey
could you please share with me the NEDC excel data

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

카테고리

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