How to arrange datetime vertically

8 ビュー (過去 30 日間)
Lemea Akara
Lemea Akara 2021 年 6 月 29 日
コメント済み: Lemea Akara 2021 年 6 月 29 日
Hello, How can I make my datetime appear in rows. Say, 01/Feb/2012 to 31/Dec/2021. I tried using transpose but it did not work. I want the date to appear vertically showing every date from 01/Feb/2012 to 31/Dec/2021 instead of horizontally.

採用された回答

Rik
Rik 2021 年 6 月 29 日
Transpose should work as expected:
(datetime(2012,02,01):datetime(2021,12,31)).'
ans = 3622×1 datetime array
01-Feb-2012 02-Feb-2012 03-Feb-2012 04-Feb-2012 05-Feb-2012 06-Feb-2012 07-Feb-2012 08-Feb-2012 09-Feb-2012 10-Feb-2012 11-Feb-2012 12-Feb-2012 13-Feb-2012 14-Feb-2012 15-Feb-2012 16-Feb-2012 17-Feb-2012 18-Feb-2012 19-Feb-2012 20-Feb-2012 21-Feb-2012 22-Feb-2012 23-Feb-2012 24-Feb-2012 25-Feb-2012 26-Feb-2012 27-Feb-2012 28-Feb-2012 29-Feb-2012 01-Mar-2012
  1 件のコメント
Lemea Akara
Lemea Akara 2021 年 6 月 29 日
Thank you @Rik.

サインインしてコメントする。

その他の回答 (1 件)

KSSV
KSSV 2021 年 6 月 29 日
t0 = datetime(2012,1,1) ;
t1 = datetime(2021,12,31) ;
t = (t0:t1)' ;
t(1:10)
ans = 10×1 datetime array
01-Jan-2012 02-Jan-2012 03-Jan-2012 04-Jan-2012 05-Jan-2012 06-Jan-2012 07-Jan-2012 08-Jan-2012 09-Jan-2012 10-Jan-2012
  1 件のコメント
Lemea Akara
Lemea Akara 2021 年 6 月 29 日
Thanks you @KSSV

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by