Question: I'm debugging code that our teacher gave us and I'm basically stuck at line 13 where it tells me that the index exceeds matrix dimensions
I'm debugging code that our teacher gave us and I'm basically stuck at line 13 where it tells me that the index exceeds matrix dimensions (see pictures below) It's either j or i but I have no idea what to change and I know this sounds like a dumb question but any help would be appreciated! Thank you!
(This is MATLAB by the way).


2 clear; clc 3 n 2 5 501 5 nn-720 6 angle linspace (-2 pi, 2 *pi, nn) 8 L for j 1:720 z n (j) for i F1:nn-1 10 for k 1 z ns 2 +1 12 S (j, i) S (j, i) (1) k* (angle (i) (ns) factorial (ns) 14 end end 16 end 17 18 19 yl sin (angle) 20 3 0; 21 22 clf grid On 23 hold. on 24 plot (angle yl, 'b', angle, S (1 g', angle, y3 k', 'LineWidth' 2 25 plot (angle, S (2 m', agle, S (3, --y', "Line Width' ,2 26 hold. off 27 axis (C-2 pi 2 pi -1.5 1 5]) 28 xlabel ('Angle (rad) 29 ylabel ('sin (x) 30 title ('Taylor Series Approximation of Sine
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
