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

2 views (last 30 days)
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
  2 Comments
pfb
pfb on 13 Apr 2015
Edited: pfb on 13 Apr 2015
exactly the same question was asked a few minutes before :)
And possibly a million times before.

Sign in to comment.

Accepted Answer

Jan
Jan on 13 Apr 2015
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.
  3 Comments

Sign in to comment.

More Answers (0)

Categories

Find more on Resizing and Reshaping Matrices in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by