Search for question
Question

The attached script named fa3q3_with_errors.m was supposed to recreate the figure below, but the code contains several errors. Find the errors and rewrite the script correctly.

Figure explanation (see also comments in the script) The figure above shows three curves plotted in the same figure window. The blue curve y1 is the plot of the rational function

The above formula estimates exp(-x) for small values of x. The red curve y2 is the plot of the decaying exponential function exp(-x). Finally, the black dash-dotted line y3 shows a horizontal line with y-coordinate 0.

Fig: 1

Fig: 2