Dear all,
My goal is to have an array with 8760 rows (number of hours in a year). Each row should now indicate the day-number of each month, which will mean that I have in the first rows 23x the number 1, then 23 times the number 2, ….. till the end of the month 23 times the number 31 (for January). Then it begins again with 23 times 1,…., till the end of February with 23 times 28.
I have created the following code:
n=23 ; x31=(1:31)'; x30=(1:30)'; x28=(1:28)'; Jan=repmat(x31,1,n)'; Jan=Jan(:)'; Feb=repmat(x28,1,n)'; Feb=Feb(:)'; Mar=repmat(x31,1,n)'; Mar=Mar(:)'; Apr=repmat(x30,1,n)'; Apr=Apr(:)'; Mai=repmat(x31,1,n)'; Mai=Mai(:)'; Jun=repmat(x30,1,n)'; Jun=Jun(:)'; Jul=repmat(x31,1,n)'; Jul=Jul(:)'; Aug=repmat(x31,1,n)'; Aug=Aug(:)'; Sep=repmat(x30,1,n)'; Sep=Sep(:)'; Okt=repmat(x31,1,n)'; Okt=Okt(:)'; Nov=repmat(x30,1,n)'; Nov=Nov(:)'; Dez=repmat(x31,1,n)'; Dez=Dez(:)';
Now, I would like to append the rows to have one big array of 8760 rows (= time.day(8760,1)) that each indicate the day-number.
However, the code cat() does not allow me to append two arrays of different length.
I am very pleased for a hint.
With kind regards
Best Answer