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

Q #1 1- Declare a row vector called t that starts at 0 and ends at 2 with step s

ID: 3743015 • Letter: Q

Question

Q #1 1- Declare a row vector called t that starts at 0 and ends at 2 with step size of 0.001. 2- Declare a function f1 such that it is mathematically expressed as f(t) -0.5t 3- Declare a new function f2 such that it is mathematically expressed as f(t) - 2exp(-t) Q #2 1- 2- 3- Declare a matrix R that is a (10x10) matrix of random numbers Assign all elements of the row 10 of R to zero (use only one command) Assign all elements of the column 5 of R to zero (use only one command) Q #3 1. Define a complex number Z 5+3i in rectangular form. What is its exponential form? 2. Write list of Matlab commands to output the real part, imaginary part, absolute value, angle, and conjugate of Z Declare a new variable Y that is equal to Z but declared using in exponential form in MATLAB. 3.

Explanation / Answer

Q#1>

1. Declare a row vector called t that starts at 0 and ends at 2 with step size of 0.001.

t= 0:0.001:2

2. Declare a function f1 such that it is mathematically expressed as f(t) = 0.5t^2

function t = f(x)

t = (0.5)*t*t;

end

3. Declare a function f2 such that it is mathematically expressed as f(t) = 2exp(-t)

function t = f(x)

t= 2*exp(-x);

end

Q#2 1. Declare a matrix R that is a (10x10) matrix of random numbers

R =zeros(10);

for i = 1:10
for j = 1:10
R(i,j) = rand;
end
end

2)
Assign all elements of row off R to zero

R(10,:) = 0;

3) Assign all elements of the column 5 of R to zero

R(:,5) = 0;

Q #3:

1. Define a complex number Z = 5+3i in rectangle form

Z = 5+3i;

>>> angle(Z)
ans = 0.54042
>>> abs(Z)
ans = 5.8310

Hence the exponential form is

2) Write a list of matlab commands to output the real part imaginary part absolute value angle and conjugate of Z

real(Z)

imag(Z)

abs(Z)

angle(Z)

conj(Z)

3) Declare a new variable Y that is equal to Z but declared using exponential form in matlab

Y = sqrt(34)*exp(i*atan(3/5));

Happy Chegging!