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

Create a 1 Times n (n > 60) matrix A filled with numbers in the range -pi to pi.

ID: 1715091 • Letter: C

Question

Create a 1 Times n (n > 60) matrix A filled with numbers in the range -pi to pi. Create a new matrix B in which each element is the tangent of the corresponding element in matrix A. Plot B vs. A in subplot 1, grid on, please include axis labels, title and legend in the plot. Now, create a matrix C in which each element is the arc-cotangent of the corresponding element in matrix B. Plot C vs. A in subplot 2, grid off, please include axis labels, title and legend in the plot. Finally, create a matrix D in which each element in matrix C, which has each angle value expressed in radians, is converted to the corresponding angle value expressed in degrees using the relationship that n radians equal 180 degree.

Explanation / Answer

%let n=70
a=-pi
b=pi
A=a + (b-a).*rand(1,70)% a)A matrix
B=tan(A) %b) B matrix
subplot(2,1,1)
plot(A,B);xlabel('A');ylabel('B');title('B vs A');legend('B=tan(A)')
grid on;
C=atan(B) %c) C matrix
subplot(2,1,2)
plot(A,C);xlabel('A');ylabel('C');title('C vs A');legend('C=tan^-1(A)')
grid off;
D=(180/pi)*C %d)D matrix