Plotting with a for Loop
Write a script file to plot the function:
Solution
We choose a spacing dx = 35/300 to obtain 301 points, which is sufficient to obtain a smooth plot. The script file is the following:
Note that we must use the index k to refer to x within the loop, as x (k ).