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

this is in MATLAB Create a figure that has two curves. Both curves will be on a

ID: 675056 • Letter: T

Question

this is in MATLAB

Create a figure that has two curves. Both curves will be on a common set of axes.

The two curves are: y=sin(2*pi*t) and x=cos(2*pi*t)

The first curve should have a solid black line, and the second curve should have a dashed blue line.

You are free to choose the sample period. If you choose a sufficiently small sample period, the two curves will look correct. If your curves don’t look like a sine-wave and a cosinewave, consider the possibility that your sample period is too large.

The horizontal axis should run from 0 to 4, and the vertical axis from 1 to 1. On the vertical axis, the tick marks (and tick labels) should be located only at 1, 0, and 1.

Use a font size of 18. Use a line width of 2 points for all lines.

Apply suitable x-axis and y-axis labels and a suitable figure title.

Explanation / Answer

close all;

clear all;

t = 0:0.05:4;

y=sin(2*pi*t);

plot(t,y,'k','linewidth',2);

title('Sine-Cosine Waveforms.', 'fontsize',18);

grid on;

xlabel('time','fontsize',18);

ylabel('2*pi*t','fontsize',18);

hold on;

x = cos(2*pi*t);

plot(t,x,'-.b','linewidth',2);

legend ('sine', 'cosine');

set(gca,'YTick',[-1 0 1])