Question

Practice: Plot x vs y when y sin(x), y cosx), y sin (2x), and y-2 sin(x) when x-1:0.1:10. Use 2 by 2 subplot, sin(x) is in location 1, cos(x) is in location 2, sin(2x) is in location 3 and 2 sin(x) is in location 4 The plot should have: (1) x labe|-х value, y label = y value, legend y=sin(x), y-cos(x), y-sin (2*x), y-y-2*sin(x), and title = X Vs. y, under Font Name of Times New Roman, and Font Size of 14 pt. for all subplot location (2) For sine(x) use red solid line, for cos(x) use blue dashed line, for sin(2*x) use green dash-dot line, and for 2*sin(x) use solid line and RGB [0.5 0.2 0.2] (3) Create minor grid for all subplot location. For your submission, only attach code and figure
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dear Student here is your required code and figure for your problem.

Please rate my answer if you got help from my answers.

Here is your code

_______________________________________________________________________________

x=1:0.1:10;
subplot(2,2,1)
plot(x,sin(x),'color','red');
grid minor
title('x Vs. y','FontSize',14,'FontName','Times New Roman');
xlabel('x value','FontSize',14,'FontName','Times New Roman');
ylabel('y value','FontSize',14,'FontName','Times New Roman');
legend('y=sin(x)');

subplot(2,2,2)
plot(x,cos(x),'--','color','blue');
grid minor
title('x Vs. y','FontSize',14,'FontName','Times New Roman');
xlabel('x value','FontSize',14,'FontName','Times New Roman');
ylabel('y value','FontSize',14,'FontName','Times New Roman');
legend('y=cos(x)');

subplot(2,2,3)
plot(x,sin(2*x),'-.','color','green');
grid minor
title('x Vs. y','FontSize',14,'FontName','Times New Roman');
xlabel('x value','FontSize',14,'FontName','Times New Roman');
ylabel('y value','FontSize',14,'FontName','Times New Roman');
legend('y=sin(2*x)');

subplot(2,2,4)
plot(x,2*sin(x),'color','[0.5 0.2 0.2]');
grid minor
title('x Vs. y','FontSize',14,'FontName','Times New Roman');
xlabel('x value','FontSize',14,'FontName','Times New Roman');
ylabel('y value','FontSize',14,'FontName','Times New Roman');
legend('y=2*sin(x)');

Here is screenshot of code followed by plot

x 1:0.1:10; subplot (2,2,1) plot (x, sin(x), color, red) grid minor title (x Vs. y, Fontsize,14, FontName, Times Ne

Add a comment
Know the answer?
Add Answer to:
Practice: Plot x vs y when y sin(x), y cosx), y sin (2"x), and y-2 sin(x)...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT