MATLAB: How to arrange datetime vertically

arrange datetime

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.

Best Answer

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
Related Question