User Tools

Site Tools


gibson:teaching:spring-2016:math445:lab3

**This is an old revision of the document!** ----

A PCRE internal error occured. This might be caused by a faulty plugin

====== Math 445 lab 3: scripts, plotting, and publishing ====== Write a single Matlab script file that solves the following problems, and use the [[http://www.mathworks.com/help/matlab/matlab_prog/publishing-matlab-code.html | Matlab ''publish'']] function to create a nice-looking PDF of your code and graphs to turn in. Be sure to label each problem with comments like ''<nowiki> %% Problem 1%% </nowiki>'' so that the problems are separated and labeled in the PDF. **Problem 1:** Redo problem 15 from lab 2 using a Matlab script. The problem is make a plot of the polynomial $f(x) = x^3 -5x^2 + 2x + 3$ over the range $-1 \leq x \leq 5$. Give the plot square axes and the title "math 445 lab 3 problem 1". **Problem 2:** Make a plot of $y(x) = 147 \times 10^{-2x}$ over the range $0 \leq x \leq 4$ using a dashed magenta line. Chose an appropriate plotting function that best displays the functional relationship between $x$ and $y$. Label the axes and place a coordinate grid within the plot. Title the plot "math 445 lab 3 problem 2". **Problem 3:** Make a plot of $y(x) = 0.3 \log x + 2$ over the range $1 \leq x \leq 10^5$ using a dot-dashed cyan line. Chose an appropriate plotting function that best displays the functional relationship between $x$ and $y$. For this plot, it's best to create the ''x'' vector with ''logspace'' rather than ''linspace''; e.g. ''x = logspace(0,5,20)'' will set ''x'' to 20 points between $1 = 10^0$ and $10^5$ which are uniformly spaced on a logarithmic plot. Label the axes, set the $y$ range of the plot to $2 \leq y \leq 6$, and place a coordinate grid within the plot. Title the plot as in previous problems. **Problem 4:** Make a plot of $y(x) = 10 x^{-3}$ over the range $10 \leq x \leq 10^4$ using a solid green line. Chose an appropriate plotting function that best displays the functional relationship between $x$ and $y$. Use the ''logspace'' function for ''x'' as in problem 3. Label the axes, set the $x$ range of the plot to $0 \leq x \leq 10^5$, and place a coordinate grid within the plot. Title the plot as in previous problems.

gibson/teaching/spring-2016/math445/lab3.1454510906.txt.gz · Last modified: 2016/02/03 06:48 by gibson