In: Computer Science
write the MATLAB code for: Let ? = sin2 (?) and ? = sin(?) cos(?). Let x vary from 0 to 10? in increments of 0.1?. Plot two figures part a & b. This panel has rows, one figure per row. a. Plot x versus y. This plot is on the top of panel and the next figure (part b) is at bottom of panel. i. Give a meaningful title to this figure. ii. x-axis is time with unit of s. y-axis is voltage with unit of V. Label both x- and yaxis. iii. Add a legend to the graph. b. Plot x versus z. This figure is at bottom row. i. Give a meaningful title on graph. ii. Label x-axis is time with unit of s. y-axis is voltage with unit of V. Label both xand y- axis. iii. Change the thickness of this curve. Use any value other than default value. iv. Change curve to red dashed curve. v. Add a legend to the graph.
`Hey,
Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.
clc
clear all
close all
format long
x=0:0.1*pi:10*pi;
y=sin(x).^2;
z=sin(x).*cos(x);
subplot(2,1,1)
plot(x,y);
title('Plot of x vs y');
xlabel('Time (s)');
ylabel('Voltage (V)');
subplot(2,1,2)
plot(x,z,'--r','LineWidth',3);
legend('Voltage');
title('Plot of x vs z');
xlabel('Time (s)');
ylabel('Voltage (V)');
Kindly revert for any queries
Thanks.