User Tools

Site Tools


gibson:teaching:fall-2014:math445:hw3

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

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

====== Math 445 HW5 ====== **Problem 1:** Given the vectors x=[3 7 2 9 0] and y=[7 10 2 8 13], what would be the Matlab output for the following expressions? Think through what the answer should be, write it down, and then try it out in Matlab. If you got anything wrong, figure out what your mistake was and why Matlab gave the answer it did. <code> (a) x > y (b) y < x (c) x == y (d) x <= y (e) y >= x (f) x & y (g) x & (~y) (h) (~x) & (y) (i) x | y (j) xor(x,y) (k) (x > y) & (y < x) </code> **Problem 2:** Write down Matlab expressions for the following. You can assume that ''a,b,c'' are logical variables, ''x,y,z'' are double-precision numbers, ''u,v,w'' are vectors of the same dimension, and ''A,B,C'' are matrices of compatible sizes. (a) Both ''a'' and ''b'' are true.\\ (b) Neither ''a'' nor ''b'' is true. \\ %%(c)%% Either ''a'' and ''b'' are true, or both ''b'' and ''c'' are false.\\ (d) Either ''x'' equals ''y'', or ''x'' is not equal to ''z''.\\ (e) ''x, y,'' and ''z'' are all equal.\\ (f) None of the components of ''u'' equal the corresponding components of ''v''.\\ (g) Each component of ''u'' is the same as either the same component of ''v'' or ''w''.\\ (h) The vector whose components are the polynomial $3u^2 - 5u + 6$ evaluated at each of the components of ''u''.\\ (i) The matrix product $AB$.\\ (j) The matrix whose elements are the product of the elements of ''A'' and ''B''.

gibson/teaching/fall-2014/math445/hw3.1411589176.txt.gz · Last modified: 2014/09/24 13:06 by gibson