Categories: Order Term Paper

Engineering Problem Solving II

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. 

 

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

 

  1. Create a column vector that has the following elements: 67.3, , 5!, 0.0089, e5, 0, log(3), sin2(15).

 

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

 

  1. 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.

 

  1. 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.

 

  1. 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.

 

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

 

  1. Create two row vectors: X = [2:3:17] and Y = [3:4:15].
  2. 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.
  3. 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.

 

  1. 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.

 

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