this code will help you out, but i am not sure about the graph of fourth figure but x/y yields to tan graph that is what i am getting since x is sin function and y is cos function
clc
clear all
close all
a1=2;
a2=0.5;
t=0:0.01:1;
T=0.33;
y1=a1*sin(2*pi*t/T);
y2=a2*cos(2*pi*t/T);
figure
plot(t,y1)
hold on
plot(t,y2,'o')
grid on
ylabel('Time')
xlabel('Volts')
title('Your Name')
figure
subplot(2,2,1)
plot(t,3*y1)
title('3*x')
subplot(2,2,2)
plot(t,3*y2)
title('3*y')
subplot(2,2,3)
plot(t,y2.*y1)
title('x*y')
subplot(2,2,4)
plot(t,y1./y2)
title('x/y')
4 Comments
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/519593-how-to-write-a-code-to-get-these-figures#comment_847269
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/519593-how-to-write-a-code-to-get-these-figures#comment_847269
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/519593-how-to-write-a-code-to-get-these-figures#comment_859778
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/519593-how-to-write-a-code-to-get-these-figures#comment_859778
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/519593-how-to-write-a-code-to-get-these-figures#comment_860013
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/519593-how-to-write-a-code-to-get-these-figures#comment_860013
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/519593-how-to-write-a-code-to-get-these-figures#comment_877339
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/519593-how-to-write-a-code-to-get-these-figures#comment_877339
Sign in to comment.