Stuart’s MATLAB Videos

Watch and Learn

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

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 dfferent 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.
|
  • print

评论

要发表评论,请点击 此处 登录到您的 MathWorks 帐户或创建一个新帐户。