====== 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-2012:math445:lab2 [2012/09/03 19:08] gibson |
gibson:teaching:fall-2012:math445:lab2 [2012/09/04 06:58] (current) gibson |
||
---|---|---|---|
Line 9: | Line 9: | ||
- | **Attaway 23:** Create the following vectors twice, once using **linspace** and once using the colon operator. | + | Attaway 23: Create the following vectors twice, once using **linspace** and once using the colon operator. |
1 2 3 4 5 6 7 8 9 10 | 1 2 3 4 5 6 7 8 9 10 | ||
Line 15: | Line 15: | ||
2 7 12 | 2 7 12 | ||
| | ||
- | **Attaway 25:** Use the colon and transpose operators to create a column vector that has values -1 to 1 in steps of 0.2. | + | Attaway 25: Use the colon and transpose operators to create a column vector that has values -1 to 1 in steps of 0.2. |
- | **Attaway 26:** 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. | + | Attaway 26: 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. |
- | **Attaway 27:** 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**. | + | Attaway 27: 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**. |
- | **Attaway 34:** 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. | + | Attaway 34: 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. |
- | **Attaway 37:** Create a 3 x 5 matrix of random real numbers, and then delete the third row. | + | Attaway 37: Create a 3 x 5 matrix of random real numbers, and then delete the third row. |
- | **Problem 2:** Use Matlab to solve the problem. Nilanjana has 51 coins worth $9.25. They're all quarters and nickels. How many nickels and how many quarters does she have? | + | **Problem 2:** Use Matlab to solve the problem. Nilanjana has 50 coins worth $9.10. They're all quarters and nickels. How many nickels and how many quarters does she have? |
**Problem 3:** Use Matlab to solve the problem. Flying against the wind, a plane travels 2880 miles in 4.5 hours. Flying with the wind, it travels the same distance in 4 hours. How fast is the wind? How fast is the plane on a windless day? | **Problem 3:** Use Matlab to solve the problem. Flying against the wind, a plane travels 2880 miles in 4.5 hours. Flying with the wind, it travels the same distance in 4 hours. How fast is the wind? How fast is the plane on a windless day? | ||
- | **Problem 4:** Use Matlab to solve the problem: | + | **Problem 4:** (bonus) Use Matlab to solve the problem. A man is three times as old as his son was at the time when the father was twice as old as his son will be two years from now. Find the present age of each if their ages now sum to 55. |
+ | **Problem 5:** From //Numerical Computing with Matlab// by Clive Moler. | ||
+ | |||
+ | {{:gibson:teaching:fall-2012:math445:truss2.png?direct&600}} | ||
+ | |||
+ | {{:gibson:teaching:fall-2012:math445:truss3.png?direct&600}} | ||
+ | |||
+ | {{:gibson:teaching:fall-2012:math445:truss4.png?direct&600}} |