Info

This question is closed. Reopen it to edit or answer.

I have 10 .txt files. In each of these files I have a column of datetime and another column for data. I want to generate a sequence of datetime for the next 500 months for eahc file

1 view (last 30 days)
file 1: start date: 05-2010 ; end date: 10-2017
file 2: start date: 07-2006 ; end date: 12-2016
(i want dates for the next 500 months to be added below in this same column; in each file)

Answers (1)

Peter Perkins
Peter Perkins on 14 May 2018
There's not a lot to go on here. Presumably you will want to read in a file, do somethign in MATLAB, and then write out another file. readtable and writetable are probably the way to go, and the "roll-over" behavior built into datetime may be helpful:
>> datetime(2010,5,1) + calmonths(0:100:500)
ans =
1×6 datetime array
01-May-2010 01-Sep-2018 01-Jan-2027 01-May-2035 01-Sep-2043 01-Jan-2052

Community Treasure Hunt

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

Start Hunting!