I keep receiving this error. Unable to perform assignment because the indices on the left side are not compatible with the size of the right side. What does this mean? I am going to use the values in this array in a for loop which I am going to plot.

1 view (last 30 days)
Cd(a)=[ 0 0 0 0 .5 .10 1 .15 .20];

Answers (1)

Walter Roberson
Walter Roberson on 16 Sep 2018
For that to work, variable a would have to be a vector of 9 positive integral values, or else a would have to be logical and have 9 locations that were true.
Note that if you are using Octave (the wording of the error message is not what MATLAB would use) then the rules could potentially be different.

Categories

Find more on Entering Commands in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!