# 1. [10 pts] working with matlab scalars, vectors, and complex

MAE 215: Introduction to Programming in MATLAB, Fall 2016

Homework Assignment #2

Due: Tuesday, September 20th by 11.59 pm

Submission Instructions: Your solutions to this assignment must be typed and neatly

presented. Unsystematic solutions and/or solutions that do not introduce the required

deliverables procure not be graded and hold a jaw of cipher. This assignment is to be

submitted, in PDF format, to the assignment concatenate on blackboard by the deadline.

- Students who earn a jaw of 80% or important on problems #2 and #3 procure hold security for

outcome #1: students procure conduct advancement in the use of spiritless MATLAB businesss.

- Well schemeatic homework submitted as M-file that can be compiled and run to likeness the

answers procure be awarded extra points.

1. [10 pts] Working after a while MATLAB scalars, vectors, and compound mass.

Using MATLAB, determine a uncommon wavering for the forthcoming quantities.

a. 5 (ex. Determine x = 5, etc.)

b. 252

c. (3 + 4) + 82

d. √36 + 72

e.

f.

g.

h.

i.

j.

72

5 +6.54

the area of a dispersion of radius 11.21

the boundary of the similar dispersion in (f)

the area of a clear after a while edge protraction 7.81

the edge protraction of a cube of quantity 107.81.

the lump of the vector in (c) (hint: seem into existent(), imag() or abs())

2. [25 pts] Using built-in businesss to discuss MATLAB waverings.

a. determine the forthcoming vector: (problems a – f)

= < √15, 13,34,72 , √54, 89.2,0.541, 7/8 , 10, log10 34.2 >

b. what is the max and poverty rate of the over vector? In what atoms are

these rates set-up?

c. confront the clear rise, cube rise and 7th rise of this vector using a sole performance.

d. what is the protraction of the vector? How manifold atoms does it enjoy? (you must use

MATLAB to determine/verify this)

e. Replace the max rate of the vector after a while a rate 8.1x its dimension after a whileout redefining

the undiminished vector. Do the similar after a while the poverty rate.

f. educe a new, uncommon, vector containing the 3rd, 7th and decisive rates of the vector in

(a).

g. determine a vector from 0 to 10 after a while 100 identical spaced entries (hint: seem at

linspace)

h. determine a vector ranging from 110 to 120 after a while a trudge dimension of 0.1. What is the protraction

of the ending vector?

i. evaluate the trigonometric businesss sin and cos from 0 to 2 radians in trudges of

0.1.

j. deliberate the forthcoming vector:

2 3 4 5 6 7 8

< 1, , , , , , , , >

2! 3! 4! 5! 6! 7! 8!

determine this vector in matlab for a user-selected rate of x. Confront a MATLAB business

that procure sum the entries of this vector coincidently. Compare your defense to

MATLAB’s exp(x) for the similar rate of x. Are your defenses reasonably obstruct?

What does the built-in business you set-up answer to do?

k. determine a vague 100 x 1 vector (be knowing to extinguish the output). What are the

mean, median and legislation? (hint: use rand(m,n)).

3. [25 pts] Understanding MATLAB matrices.

a. determine the forthcoming matrices in MATLAB: (problems a - g)

6 5 1

= [12 2 0]

2 1 6

= [6, 17, 8]

b. what are the eigenvalues of A (hint: eig())? What is the determinant of A? (confront a

MATLAB business that can do this for you) What is A-1?

c. Replace the max and min rates of A after a while the rates of a11 and a12, respectively.

d. Educe a new matrix from the decisive two rows of A and the vector B after a whileout

redefining the scheme.

e. what is the sum of the leading row of A? Leading column of A?

f. How manifold atoms are in A? B? (must use MATLAB to verify end) Multiply

each atom in A by 7.2 and each atom in B by 2. Confront a way to multiply

matrices A and B. What must you do? How did you complete this?

g. Flip the vector B from fit to left. Transpose the matrix into a column vector and

flip it once frequently from up to down.

h. determine a vague 6x6 matrix, a 3x3 matrix of ciphers, 3x3 matrix of ones and the 4x4

identity matrix. (hint: use built-in MATLAB businesss). Confront a way to associate the

vague 6x6 matrix, the matrix of ones and the matrix of ciphers into a sole, 6x9

matrix. (hint: this procure mitigated be a 2 trudge way).

i. educe (another) vague 8x8 matrix (be knowing to extinguish the output). Confront a way

to determine two disconnected, smaller, 4x4 matrices tight of the rates from the “top

left” and “bottom fit” sub-matrices of the larger, 8x8.

j. Deliberate the vectors <3,7,1> and <5,2,0>. Confront the item vector of each, a vector

normal to twain, and the dot fruit of the two. (hint: seem for built-in businesss).