**This is an old revision of the document!** ----
====== Math 445 lecture 2: Vectors ====== Vectors are hugely important in math, science, engineering. In math, a vector is a list of numbers. E.g. this is a 3-d vector <latex> v = \left(\begin{array}{c} 4.3 \\ 5.9 \\ 0.1 \end{array} \right) </latex> In math, the components or elements of a vector are written with subscripts. E.g. for the above vector <latex> v_1 = 4.3, \quad v_2 = 5.9, \quad v_3 = 0.1 </latex> In Matlab, there's a distinction between **row vector** and **column vectors**. You can construct row vectors from explicit lists of elements like this <code> v = [4.3 5.9 0.1] % spaces between elements, or v = [4.3, 5.9, 0.1] % commas between elements </code> You can create column vectors like this <code> v = [4.3; 5.9; 0.1] % semicolons between elements, or v = [4.3 5.9 0.1]' % the transpose of a row vector </code> Note that last method. In Matlab, the apostrophe '' ' '' stands for the **transpose**. The transpose operator turns a row vector into a column vector, and vice versa. <code> >> v = [4.3 5.9 0.1] v = 4.3000 5.9000 0.1000 >> v' ans = 4.3000 5.9000 0.1000 >> u = v' u = 4.3000 5.9000 0.1000 >> w = u' w = 4.3000 5.9000 0.1000 </code>