In an Assignment A(I) = B, the Number of Elements in B and I Must Be the Same
(Originally posted on Doug's MATLAB Video Tutorials blog.)
The very common MATLAB error: “In an assignment A(I) = B, the number of elements in B and I must be the same.” occurs when one side of an assignment has a different dimension than the other. So for instance the left side of the assignment might be a vector and the target on the left is a scalar. The problem might be that both sides are vectors, but one is a different length than the other. In this video Doug shows two ways to debug this common situation.
Recorded: 20 Nov 2014
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.