Fix for " The input to DATENUM was not an array of strings."
Afficher commentaires plus anciens
I am attempting to use datenum on my table (one column, first column) of dates to convert it into a separate variable of just a series of numbers
dataset = readtable('equity_dataset_30.csv');
data = dataset(:,2:31);
date = dataset(:,1);
date_num = datenum(date, 'yyyy-mm-dd');
This last line keeps returning the error: " The input to DATENUM was not an array of strings."
Could someone show what I'm missing here?
Réponse acceptée
Plus de réponses (1)
Massimo Zanetti
le 7 Oct 2016
3 votes
Most probably your variable "date" is not an array of strings.
7 commentaires
NN
le 25 Oct 2020
kindly see the below code .i also get the same error.kindly advice
%reading date
Data=readtable('2019_SysLoad.xlsx');
save 2019_SysLoad.mat Data
testdates=Data((5834:end),1)};
testdates1=datenum(testdates1,'mm-dd-yyyy');
Walter Roberson
le 25 Oct 2020
testdates = Data{5834:end,1)};
NN
le 25 Oct 2020
thank you .But it gives the following error
Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for
mismatched delimiters.
Walter Roberson
le 25 Oct 2020
testdates = Data{5834:end,1};
NN
le 26 Oct 2020
thank you .It worked.
But i am getting spike like output when i plot datenum and forecasted output.Doesnt look lik wave form .
Kindly advice

Walter Roberson
le 26 Oct 2020
I do not see any obvious problem with the plot. It looks to me like what you would expect for a plot displayed with an unfortunate aspect ratio. Try zooming it.
Catégories
En savoir plus sur Time Series Objects dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!