MATLAB Answers

Does anyone know how to allocate a vector with datetime elements?

277 ビュー (過去 30 日間)
Somayeh Amayeh
Somayeh Amayeh 2015 年 11 月 24 日
編集済み: Chris Turnes 2015 年 11 月 24 日
I tried at the biginning allocating zeros vector, but it is not allowed to write on them datetime while the loop is executing. I tried allocating empty cells but still seems not to work.
Thanks in advance.

  0 件のコメント

サインイン to comment.

採用された回答

Chris Turnes
Chris Turnes 2015 年 11 月 24 日
編集済み: Chris Turnes 2015 年 11 月 24 日
This question has appeared before, but there are two options I didn't see in that thread. One is to allocate an array of "Not-a-Time" elements with NaT:
d = NaT(1, 100);
Another is to do something like:
d(100) = datetime; % or NaT, or any datetime you want
which effectively does the same thing.

  0 件のコメント

サインイン to comment.

その他の回答 (0 件)

サインイン してこの質問に回答します。


Translated by