MATLAB: Index exceeds matrix dimensions. Error in HW2 (line 82) CL(i) = a(i)*(AOA(i) – alp0);

dimensionsmatrix

I am trying to create a plot with multiple varying functions but i keep getting the error that the index exceeds the matrix dimensions.

Best Answer

Your for 1:1:10 initializes a(1) to a(10). The loop after that is to length(k) which is 33 so it tries to use a(1) to a(33) but a(11) onwards does not exist