Error using datenum (line 201) DATENUM failed.
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Rachele Franceschini
el 18 de Nov. de 2021
Comentada: Rachele Franceschini
el 18 de Nov. de 2021
Help me!
I have this error, and I don't know why.
Error using datenum (line 201)
DATENUM failed.
Caused by:
Error using dtstr2dtnummx
Failed to convert from text to date number.
My script is this:
[ndata, text, alldata]=xlsread('positive_read_Copia.xlsx'); % inside there are data (dd/mm/yyyy hh:mm:ss) and coordinates
date=date.';
tmp=char(date);
tmp_date=datenum(tmp,'dd/mm/yyyy HH:MM');
DateVector = datevec(tmp_date);
Date_minute=(tmp_date-tmp_date(1))*24*60; % Time, in minutes compared to the 1st georeferenced tweet
clear tmp;
2 comentarios
Cris LaPierre
el 18 de Nov. de 2021
Please share your spreadsheet. You can attach it using the paperclip icon.
Respuestas (1)
Stephen23
el 18 de Nov. de 2021
Editada: Stephen23
el 18 de Nov. de 2021
Do not use outdated, discouraged, deprecated DATENUM (or for that matter DATEVEC or DATESTR).
Import your data using READTABLE, which automatically identifies the dates and imports them as DATETIME objects:
T = readtable('positive_read_Copia.xlsx')
D = T.tweet_created_at - T.tweet_created_at(1)
M = minutes(D)
4 comentarios
Sean de Wolski
el 18 de Nov. de 2021
You'll also want to look at https://www.mathworks.com/help/releases/R2021b/stats/dbscan.html and either geobubble or geoplot https://www.mathworks.com/help/releases/R2021b/matlab/ref/geoplot.html.
Ver también
Categorías
Más información sobre Dates and Time en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!