MATLAB: In an assignment A(I) = B, the number of elements in B and I must be the same.

assignment a(i) = baverage

Hi Guys, first of all I am beginner in Matlab. I want to get Average Values of NDVI for each month during a year. I used this
i=1:12;
jan(i)=ndvi_avhrr_monthly_avg{i};
and then I got this Error (((In an assignment A(I) = B, the number of elements in B and I must be the same.))).
Thanks
Reyadh

Best Answer

jan(i) is a scalar and obviously the contents of ndvi_avhrr_monthly_avg{i} is not a scalar. Therefore the right hand side cannot be assigned to the left hand side.
Related Question