
Thus inner loop is executed N- times for every execution of Outer loop. When you nest two loops, the outer loop takes control of the number of complete repetitions of the inner loop. The most used plotting function in R programming is the plot() function. Syntax of Nested for loop in R: The placing of one loop inside the body of another loop is called nesting. so from 0.001 for theta to 24.47 (the number I got from using an fprintf command that showed me the.

the iteration number 1-n, n being the number of iterations the program runs until it meets the specs I set in the while loop. So Im assuming that they are asking me to plot the approximation vs.

Parameter 2 is an array containing the points on the y-axis. Parameter 1 is an array containing the points on the x-axis. The function takes parameters for specifying points in the diagram. By default, the plot() function draws a line from point to point. However, at each iteration you will also append your remaining debt total to a plot, so that you can visualize the total decreasing as you go. The plot() function is used to draw points (markers) in a diagram.

Loops can be used for all kinds of fun examples! What if you wanted to visualize your debt decreasing over time? Like the last exercise, this one uses a loop to model paying it off, $500 at a time.
