Datenum error..how to fix

2 Ansichten (letzte 30 Tage)
Yasaman Best
Yasaman Best am 11 Jul. 2017
Kommentiert: Robert U am 18 Jul. 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 Kommentar
Robert U
Robert U am 18 Jul. 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

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Dates and Time finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by