MATLAB: Create day month and year

day

I want to create three tables in Matlab Year,Month and Day and then concatenate into one column so that
1970 1 1
1970 1 2
.
.
.
1970 12 1

Best Answer

clc; clear all
iwant = [ ];
for i = 1:12
d = calendar(1970,i)' ;
d(d==0) = [] ;
d = d(:) ;
y = repmat(1970,[length(d) 1]) ; % year
m = repmat(12,[length(d) 1]) ; % month
ymd = [y m d] ;
iwant = [iwant ; ymd] ;
end
there could be some other elegant way..