reading excel data, without knowing range
16 次查看(过去 30 天)
显示 更早的评论
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');
0 个评论
回答(2 个)
Ora Zyto
2011-12-16
John, Does reading from the entire worksheet satisfy your requirements?
B = xlsread('myExample.xls', 'MySheet')
0 个评论
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
2020-5-4
编辑:Mohammed NACIRI
2020-5-4
Hey
could you please share with me the NEDC excel data
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!