Datenum error..how to fix

9 visualizaciones (últimos 30 días)
Yasaman Best
Yasaman Best el 11 de Jul. de 2017
Comentada: Robert U el 18 de Jul. de 2017
bouts_data = [datenum(raw_bouts_data(2:end,5), 'dd/mm/yyyy HH:MM:SS PM'), ...
datenum(raw_bouts_data(2:end,6), 'dd/mm/yyyy HH:MM:SS PM'), ...
cell2mat(raw_bouts_data(2:end,7:end))];
  • Error in DataLogger_DailyBouts (line 36) bouts_data = [datenum(raw_bouts_data(2:end,5), 'dd/mm/yyyy HH:MM:SS PM'), ...
Caused by: Error using datenum (line 107) The input to DATENUM was not an array of strings.*
I'm trying to read an excel file and I get this error why? How to fix it?
  1 comentario
Robert U
Robert U el 18 de Jul. de 2017
Hi, my first guess would be that you read your Excel sheet by utilizing
[num,txt,raw] = xlsread(___)
where your output raw_bouts_data is representing the "raw"-output from xlsread().
Writing now raw_bouts_data(2:end,5) gives you a cell whereas you need a string:
[datenum(raw_bouts_data{2:end,5}, 'dd/mm/yyyy HH:MM:SS PM'), ...
datenum(raw_bouts_data{2:end,6}, 'dd/mm/yyyy HH:MM:SS PM'), ...
cell2mat(raw_bouts_data(2:end,7:end))];
Kind regards,
Robert Uhlig

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Dates and Time en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by