readtable xlsx with date

조회 수: 5 (최근 30일)
Rica
Rica 2019년 4월 29일
댓글: Rica 2019년 4월 30일
Hi every one,
i have data in many excell scheets. I wrote a code to read the sheets:
numVars = 6;
VarSheet=1 ;
varNames = {'Date','Time','M1','T1','L1','L2'} ;
varTypes = {'char','char','char','double','double','double'} ;
dataRange = 'A8:F47';
opts = spreadsheetImportOptions('NumVariables',numVars,'VariableNames',varNames,'VariableTypes',varTypes,'DataRange', dataRange...
'Sheet',VarSheet);
% preview('VergleichsmessungSep3.xlsx',opts)
Meas1 = readtable('Test.xlsx',opts);
How could read Date and Time coulmns and use it for plots?

채택된 답변

Jan
Jan 2019년 4월 29일
편집: Jan 2019년 4월 29일
What about:
varTypes = {'datetime','datetime','char','double','double','double'} ;
What exactly does "use it for plots" mean?
  댓글 수: 3
Jan
Jan 2019년 4월 29일
@Rica: I'm glad if I could help you.
Please post comments in the section for comments.
Rica
Rica 2019년 4월 30일
Thanks,
I solve it like this:
DT=Date+timeofday(Time).

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

추가 답변 (1개)

KSSV
KSSV 2019년 4월 29일
T = readtable('Test.xlsx') ;

카테고리

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