Professional Documents
Culture Documents
Exp2 Code
Exp2 Code
y1 = sind(t);
y2 = cosd(t);
y_sum = y1 + y2;
y_sub = y1 y2;
y_mul = y1.*y2;
y_div = y1./y2;
%plot(t,y_div);
subplot(3,2,1)
plot(t,y1);
title('y1 = sin(x)');
xlabel('t>');
ylabel('y = sin(t)');
grid on;
subplot(3,2,2)
plot(t,y2);
title('y2 = cos(x)');
xlabel('t>');
ylabel('y = cos(t)');
grid on;
subplot(3,2,3)
plot(t,y_sum);
title('sin(x) + cos(x)');
xlabel('t >');
ylabel('y = y1+y2');
grid on;
subplot(3,2,4)
plot(t,y_sub);
title('sin(x) cos(x)');
xlabel('t >');
ylabel('y = y1y2');
grid on;
subplot(3,2,5)
plot(t,y_mul);
title('sin(x) x cos(x)');
xlabel('t >');
ylabel('y = y1 x y2');
grid on;
subplot(3,2,6)
plot(t,y_div);
title('sin(x) / cos(x)');
xlabel('t >');
ylabel('y = y1 / y2');
grid on;