====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
gibson:teaching:spring-2016:math445:lab2 [2016/01/28 09:05] gibson |
gibson:teaching:spring-2016:math445:lab2 [2016/02/02 08:35] (current) gibson |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Math 445 lab 2: vectors ====== | ====== Math 445 lab 2: vectors ====== | ||
- | Do the following in Matlab, saving your work to a file with the ''diary'' command, and labeling each problem with a Matlab comment (e.g. ''% problem 1''). 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 12, 13, and 14. Just describe them verbally using Matlab comments. . You can submit your lab either via Canvas or as a print out. | + | Do the following in Matlab, saving your work to a file with the ''diary'' command, and labeling each problem with a Matlab comment (e.g. ''% problem 1''). 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 12, 13, and 14. Just describe them verbally using Matlab comments. For 15, just provide your estimates of the zeroes of the polynomial. Turn in your diary file on Canvas. |
1. Assign a row vector with elements 3, 4, 5, 9 to the variable u. | 1. Assign a row vector with elements 3, 4, 5, 9 to the variable u. | ||
Line 31: | Line 31: | ||
14. Run | 14. Run | ||
- | <code> | + | <code matlab> |
plot(x, sin(x), 'r--', x, cos(x), 'm-') | plot(x, sin(x), 'r--', x, cos(x), 'm-') | ||
xlabel('x') | xlabel('x') |