MATLAB Answers

readtable xlsx with date

20 views (last 30 days)
Rica on 29 Apr 2019
Commented: Rica on 30 Apr 2019
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...
% preview('VergleichsmessungSep3.xlsx',opts)
Meas1 = readtable('Test.xlsx',opts);
How could read Date and Time coulmns and use it for plots?


Sign in to comment.

Accepted Answer

Jan on 29 Apr 2019
Edited: Jan on 29 Apr 2019
What about:
varTypes = {'datetime','datetime','char','double','double','double'} ;
What exactly does "use it for plots" mean?


Jan on 29 Apr 2019
[MOVED from section for answers] Rica wrote:
the goal is to build a datetime Array from Column 1 and column 2. This Array will be used in ploting data in a graphics.
I think your hint to use datetime instead of Char will help me solve this task.
Thank you Jan.
Jan on 29 Apr 2019
@Rica: I'm glad if I could help you.
Please post comments in the section for comments.
Rica on 30 Apr 2019
I solve it like this:

Sign in to comment.

More Answers (1)

KSSV on 29 Apr 2019
T = readtable('Test.xlsx') ;


Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by