====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
gibson:teaching:fall-2013:math445:hw1 [2013/09/05 12:00] gibson |
gibson:teaching:fall-2013:math445:hw1 [2013/09/06 11:55] (current) gibson |
||
---|---|---|---|
Line 11: | Line 11: | ||
**Problem 3:** Given a vector //v// of arbitrary length, write an expression that evaluates to the odd-numbered elements of //v//. Test your expression on vectors //v// of both even and odd length. | **Problem 3:** Given a vector //v// of arbitrary length, write an expression that evaluates to the odd-numbered elements of //v//. Test your expression on vectors //v// of both even and odd length. | ||
- | **Problem 4:** Given a vector //v// of arbitrary length, write assignment statements that store the first half of //v// in a vector //v1// and the second half in a vector //v2//. Make sure your assignment statements work for //v// of both even and odd length. Hint: use a rounding function such as **fix**. | + | **Problem 4:** Given a vector //v// of arbitrary length, write assignment statements that store the first half of //v// in a vector //v1// and the second half in a vector //v2//. Make sure your assignment statements work for //v// of both even and odd length. |
**Problem 5:** Create a 4 x 2 matrix of all zeros and store it in a variable. Then replace the second row of the matrix with a 3 and a 6. | **Problem 5:** Create a 4 x 2 matrix of all zeros and store it in a variable. Then replace the second row of the matrix with a 3 and a 6. | ||
Line 41: | Line 41: | ||
- | **Problem 10:** Evaluations at a university are scored 1-5, bad to good. However the evaluation forms mistakenly say that 1-5 is good to bad. So the computer program written to analyze evaluations must reversed. That is, | + | **Problem 10:** Evaluations at a university are scored 1-5, bad to good. However the evaluation forms mistakenly say that 1-5 is good to bad. So the computer program written to analyze evaluations must "reverse" all the evaluation scores. That is, |
evals = [5 3 2 5 5 4 1 2] | evals = [5 3 2 5 5 4 1 2] |