Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a script. Save your script to your desktop. Complete the following: a) Wr

ID: 3842208 • Letter: C

Question

Create a script. Save your script to your desktop. Complete the following: a) Write your name and section number on separate lines: use separate comments to accomplish this b) Define a variable x = [1 -3 5] and a variable y = [2 7 4], storing the results as variables x and y respectively c) Add pi to each element of x and store the result as the variable x; add e to each element of y and store the new result as the variable y. Do not look up the values of pi or e! d) Find cos (x) (using radians) and cot(y)(using degrees) e) Find tan^-1 (cos(x)) (using radians) and sin^-1 (cot(y)) (using degrees) f) Find the element-by-element product z = x * y. Be careful with the syntax! g) What element is in the third row, first column of z? Use a command to find the value (i.e. do not read this out from the Workspace)

Explanation / Answer

I suppose this code should suffice:

% b
% ====

% create column matrix, using ; to denote end of a column.
x = [ 1; -3; 5 ]
y = [ 2; 7; 4 ]

% c
% ====
x += pi
y += exp(y)

% d
% ====
% cosine in radians
cos(x)
% cot in degrees
cotd(y)

% e
% ====
% in radians
atan(cos(x))
% in degreees
asin(cotd(x))

asin, acos .. for sin inverse, cos inverse..

sind, cosd .. for degrees

sin, cos .. for radians

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote