Создать непрерывную строку даты в Matlab - PullRequest
0 голосов
/ 26 апреля 2018

Как я могу создать непрерывную строку даты, как это в Matlab:

'20160801'
'20160802'
'20160803'
.
.
.
'20161031'

1 Ответ

0 голосов
/ 27 апреля 2018

Это должно работать нормально:

% Define the starting and ending dates from literal representations...
date_start = datetime('20160801','InputFormat','yyyyMMdd');
date_end = datetime('20161031','InputFormat','yyyyMMdd');

% Create a range of dates using the colon operator...
date_range = (date_start:date_end).';

% Convert the dates back to the desired literal format...
date_text = datestr(date_range,'yyyyMMdd');
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...