How to creat a dataset include dates? like airline dataset?
Show older comments
the examples given in econometric toolbox usually load dataset directly, like
load Data_Airline
But in reality usually we read data from excel files or other resources, which contains data with double format and text with cell format.like:
[ndata, text, alldata] = xlsread('uscpi.xlsx');
And the dates are expressed like '1980/4/1' in the text cell. The question is ,how can I construct a dataset like Airline from read excel file? Thanks.
Answers (1)
Walter Roberson
on 16 Mar 2014
0 votes
datenum() can be used to parse dates that are in text format.
Caution: if you use the binary dates that Excel returns then they will not correspond exactly to MATLAB dates. See http://www.mathworks.com/help/matlab/import_export/when-to-convert-dates-from-excel-files.html
Categories
Find more on Dates and Time in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!