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:hw1 [2012/09/24 19:50] gibson |
gibson:teaching:fall-2012:math445:hw1 [2012/09/26 20:28] (current) gibson |
||
---|---|---|---|
Line 13: | Line 13: | ||
6. Plot //sin(x)// and //cos(x)// for 200 evenly spaced points between -π and π, on the same plot, | 6. Plot //sin(x)// and //cos(x)// for 200 evenly spaced points between -π and π, on the same plot, | ||
- | using red for //sin// and blue for //cos//. Add a legend that indicates which function is which color. | + | using red for //sin(x)// and blue for //cos(x)//. Add a legend that indicates which function is which color. |
7. Produce a vector whose components are random integers between 0 and 10, inclusive. | 7. Produce a vector whose components are random integers between 0 and 10, inclusive. | ||
Line 42: | Line 42: | ||
Write a Matlab function that | Write a Matlab function that | ||
- | 14. returns 1 (true) if its argument is divisible by 3 and 0 (false) if it's not. | + | 15. returns 1 (true) if its argument is divisible by 3 and 0 (false) if it's not. |
- | 15. takes a vector //x// as input and returns 1 if the components of //x// are sorted | + | 16. takes a vector //x// as input and returns 1 if the components of //x// are sorted |
in ascending order, 0 if not. | in ascending order, 0 if not. | ||
- | 16. finds a zero of another function using the bisection search algorithm. | + | 17. finds a zero of another function using the bisection search algorithm. |
+ | |||
+ | 18. computes the product //y = Ax// of an //m x n// matrix //A// and an //n x 1// vector //x//, according the formula | ||
+ | <latex> | ||
+ | y_i = \sum_{j=1}^n A_{ij} x_j | ||
+ | </latex> | ||