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

MATLAB CODE!!! Problem 4: Plot the functions sin(t), sin(t), and ) over the inte

ID: 1766240 • Letter: M

Question

MATLAB CODE!!!

Problem 4: Plot the functions sin(t), sin(t), and ) over the interval [0, 2] using equally spaced points with step size 0.05 on three sub-figures in a column. Note that each figure must be square without being stretched to one direction. In plots, x-axis range must be [0, 2 and y-axis range should be appropriate for the respective data. Use different line colors and symbols for each c cos(t) function. Add the title, a grid, axis labels, and texts "sin(t)y", "sin(t)2"', and suso" near each corresponding curve “sin(t), cos(t) 20 Problem 5: Repeat Problem 4 by plotting the given three functions with 3 different figures, and arrange them horizontally. Label them appropriately. 10 Problem 6: Present on the same graph the function f(x)=log,o(x) and f(x)=log,o(x--/x) between 1 and 10 using Eplot commands. Specify the appropriate values for both x-axis and y- axis. Add legends, a grid, title, and labels for both x and y axes. 20 Problem 7: Draw an exact 2-D hexagon of any size and fill the interior of the object with any color. Label every corner with its own coordinate and write "hexagon" in the middle. 20

Explanation / Answer

FIRST QUESTION SOLVED

1. MATLAB CODE

t=0:0.05:2*pi;
x1=sin(t); %% functions defined
x2=(sin(t)).^2;
x3=tan(t);
subplot(3,1,1)   
xlabel('time');
ylabel('amplitude')
title('sin(t)')
plot(t,x1,'o') ; % plot some data
set(gcf, 'Position', [50, 50, 270, 550]) %% figure resized
subplot(3,1,2)
xlabel('time')
ylabel('amplitude')
title('sin^2(t)')
plot(t,x2,'r') ; % plot some data
set(gcf, 'Position', [50, 50, 270, 550])
subplot(3,1,3)
xlabel('time')
ylabel('amplitude')
title('sin(t)/cos(t)')
plot(t,x3) ; % plot some data
set(gcf, 'Position', [50, 50, 270, 550])