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.
Video Player is loading.
Current Time 0:00
Duration 2:33
Loaded: 6.49%
Stream Type LIVE
Remaining Time 2:33
 
1x
  • Chapters
  • descriptions off, selected
  • captions off, selected
  • en (Main), selected
    |
    • print

    Comments

    To leave a comment, please click here to sign in to your MathWorks Account or create a new one.

    Loading...
    Go to top of page