how to find the first date of each month between years?
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Suresh R
am 27 Okt. 2021
Kommentiert: Suresh R
am 27 Okt. 2021
how to find the first date of each month between years for eg lets take 2000-2008. how to find first date of each month for the years from 2000 to 2008?
0 Kommentare
Akzeptierte Antwort
Cris LaPierre
am 27 Okt. 2021
dates = datetime(2000,1,1):calmonths(1):datetime(2008,12,1)
3 Kommentare
Weitere Antworten (1)
Can Atalay
am 27 Okt. 2021
years = transpose(2000:2008);
months = transpose(1:12);
[row1,col1] = size(years);
[row2,col2] = size(months);
year_month = zeros(row1*row2,3);
for ii1 = 1:row1
year_month((ii1-1)*row2+1:ii1*row2,:) = [repmat(years(ii1),[row2 1]) months repmat([1],[row2 1])];
end
datetime(year_month) % your answer
0 Kommentare
Siehe auch
Kategorien
Mehr zu Dates and Time finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!