I have a 3D matrix (12 x 14 x 360) which is 30 years monthly data. I need only months from Apri to September from all 30 years. The output matrix I expect is 12 x 14 x 180. I am getting this error: “Subscripted assignment dimension mismatch.” Correct me please.
% code
h=1:180for year=1:30; April=(year-1)*12+4; Sept=(year-1)*12+9; seasons(:,:,h)=mat(:,:,April:Sept);end
Kindly, Emgdaw
Best Answer