Datenum Problem in Octave???
显示 更早的评论
I have an Problem with implementing a Matlab Code into Octave. i have an dt = char of the size 5x21
.
dt =
yearmonthdayt [hh:mm]
2016Jan 01 00:00
2016Jan 01 00:15
2016Jan 01 00:30
2016Jan 01 00:45
>> and use
datenum( dt, 'yyyymmmddHH:MM' );
but i get the following error message in Octave:
error: datevec: DATE not parsed correctly with given Format
error: called from datevec at line 147 column 11 datenum at line 104 column 40
5 个评论
Stephen23
2017-11-13
@FishermanJack: if you have Octave problems then you should ask on an Octave forum.
Rik
2017-11-13
Sadly, there isn't such a forum for Octave (or none that I can find). I would suspect this wouldn't run correctly in Matlab either, as that first line doesn't fit the format.
FishermanJack
2017-11-13
dpb
2017-11-13
Octave isn't Matlab despite it being similar and mostly syntax-similar.
While is OT here, from the error message I'd guess the problem is the format string isn't correct case for the month/hour/day fields...there's a difference between the old datenum and the new(er) datetime in who's upper- and who's lower- case; check the doc for "who's who in the zoo"...
Walter Roberson
2017-11-13
The first entry is not parseable. The second others might have problems because of the spaces.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Octave 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!