11 Concatenate vectors

In MATLAB, a programmer can join two (or more) arrays to form a new single array using an operation called concatenation.

Given two row vectors u and v the programmer can create a new row vector w containing all of the elements of u followed by all of the elements of v by writing:

w = [u v];

Given two column vectors u and v the programmer can create a new column vector w containing all of the elements of u followed by all of the elements of v by writing:

w = [u; v];

Create a new script and save it as q6.m. To the newly created script, add some MATLAB statements that perform the following steps in order:

  1. Creates a \(1 \times 10\) vector of all zeros named u. Use the function zeros to create the vector.
  2. Creates a \(1 \times 10\) vector of all ones named v. Use the function ones to create the vector.
  3. Creates a row vector w formed by concatenating u with v
  4. Creates a \(8 \times 1\) vector of all ones named a. Use the function ones to create the vector.
  5. Creates a \(8 \times 1\) vector of all zeros named b. Use the function zeros to create the vector.
  6. Creates a column vector c formed by concatenating a with b