User Tools

Site Tools


gibson:teaching:spring-2016:math445:lab2

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

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

====== Math 445 lab 2: vectors ====== Do the following in Matlab, saving your work to a file with the ''diary'' command. Reduce unnecessary whitespace with the ''format compact'' command. When you're done, edit the diary file to eliminate errors, so that your diary shows just the correct work. You do not need to turn in the plots of 9, 10, or 11. Just describe them verbally. You can submit your lab either via Canvas or as a print out. 1. Assign a row vector with elements 3, 4, 5, 9 to the variable u. 2. Assign the transpose of u to the variable w. 3. Change the third element of w to 10. 4. Create a vector of the even integers between 2 and 14, inclusive. 5. Create a vector of the odd integers between 7 and 19, inclusive. 6. What is the sum of every third number between 3 and 27, inclusive? 7. What is the sum of the integers between 1 and 100, inclusive? 8. Make x a vector from 0 to $2\pi$ in increments of 0.02. 9. Run ''plot(x, sin(x))''. What happens? 10. Run ''plot(x, sin(x), 'r--')''. What happens? 11. Run <code> plot(x, sin(x), 'r--', x, cos(x), 'm-') xlabel('x') legend('sin x', 'cos x') </code> What happens?

gibson/teaching/spring-2016/math445/lab2.1453931459.txt.gz · Last modified: 2016/01/27 13:50 by gibson