**ENGR 102: Engineering Problem Solving II**

**MATLAB Homework 4: 1D Arrays**

**Required Homework**

**Solve all problems in a single script file in MATLAB. Ensure that your file is saved as LastName_FirstName_HW4before submitting. **

- Create a row vector that has the following elements: 9, 6/7, sin(70), ln(2), 0.25, 15*2, cos(2π) and 0.

- Create a column vector that has the following elements: 67.3, , 5!, 0.0089, e
^{5}, 0, log(3), sin^{2}(15).

- Define the variables t=25 and p=6. Then use them to create a column vector that has the following elements: t, t
^{p}, ln(t/p), t*p and t^{2}-p.

- Create a row vector in which the first element is 1 and the last is 43, with an increment of 6 between the elements. Do no enter in each element explicitly.

- Create a column vector in which the first element is 10 and the last element is 0, where the spacing between elements is 2. Do not enter in each element explicitly.

- Use a single command to create a row vector with 8 elements such that the last two elements are 4 and the rest of the elements are zeros. Do not type the vector explicitly.

- Use a single command to create a row vector with 11 elements such that V=0246810129630. Do not type in the vector ex

- Create two row vectors: X = [2:3:17] and Y = [3:4:15].
- By only using the names of the vectors, create a row vector
*a*that is made from the elements of*X*following by the elements of*Y*. - By only using the names of the vectors, create a row vector
*b*that is made from the first 4 terms in*X*and the last 2 terms in*Y*.

- Use the colon operator to create a row vector where the first term is 2 and the last term is 16 with a spacing of 2 between the elements.

- Use the vector created above, replace the 3
^{rd}element with a 0. - Use the vector from part a and replace elements 4-6 with -1s.