Answer to Question #168067 in MatLAB for Rj Tay

Question #168067

Plot the following functions on the same graph for x values from -π to π. selecting spacing to create a smooth plot: y1 = sin (x) y2 = sin(2x) y3 = sin(3x)


1
Expert's answer
2021-03-02T04:54:31-0500
x = -3.14:0.01*3.14:3.14;

y1 = sin(x);
plot(x,y1)
hold on

y2 = sin(2*x);
plot(x,y2)
hold on

y3 = sin(3*x);
plot(x,y3)
hold off

title('Figures for y1, y2 and y3')
xlabel('x in radians');
ylabel('sin(x)/sin(2x)/sin(3x)');
legend('sin(x)','sin(2x)','sin(3x)')
grid

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS