how to create array datetime
古いコメントを表示

i want datetime in this format :
01/02/2008 501 (day/month/years and time)
i try it :
bbb=datetime(bb,"InputFormat", "dd/MM/yyyy");
but i get error format

1 件のコメント
Cris LaPierre
2024 年 5 月 13 日
Based on your graphic, 01/02/2008 501 is actually (month/day/year time)
採用された回答
その他の回答 (2 件)
Cris LaPierre
2024 年 5 月 13 日
編集済み: Cris LaPierre
2024 年 5 月 13 日
You have the correct function, just the wrong syntax. The biggest issue I see with the conversion is that your time appears to be in millitary format, or HHmm.
I therefore think the simplest approach is to convert your array into a string arrary and then use the syntax t = datetime(DateStrings)
load matlab_A.mat
A
% Capture the time
D = datetime(num2str(A),'InputFormat',"yyyy M d Hmm",'Format',"dd/MM/yyyy Hmm")
カテゴリ
ヘルプ センター および File Exchange で Dates and Time についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
