Converting Numeric Dates in Matlab does not work
2 ビュー (過去 30 日間)
古いコメントを表示
I have a date column in my table with dates in numeric format, e.g. one date might look like this: 738570
When I try to convert it like this:
table1.Date = date(table1.Date)
I get this error:
Error using date Too many input arguments
2 件のコメント
Stephen23
2022 年 3 月 3 日
The DATE function does not accept any input arguments:
What do you expect to happen when you call a function with more input arguments than it accepts?
採用された回答
その他の回答 (1 件)
Steven Lord
2022 年 3 月 3 日
Another way to do this is to convery the serial date number to a datetime using the 'ConvertFrom' name-value pair argument.
x = 738570;
dt = datetime(x, 'ConvertFrom', 'datenum')
Let's check, since a datenum is the "Number of days since 0-Jan-0000 (proleptic ISO calendar)."
check = datetime(0, 1, 0) + caldays(x) % x calendar days after 0-Jan-0000
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Calendar についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!