Basic trigonometry function | Scigyan

Basic trigonometry function

Basic-trigonometry-function-logoMatlab program to plot trigonometry function sine wave, cosine wave, tangent wave, cosec wave, etc. This is an example. You can plot other trigonometry function similarly.

Matlab code: 

clc;clear all;close all;
t=0:.2:15; % Time axis
% GENERATION OF SINE WAVE
x=sin(t);
subplot(3,2,1);
plot(t,x);
title('SINE WAVE');xlabel('t-->');ylabel('Amplitude-->');
% GENERATION OF DISCRETE SINE WAVE
subplot(3,2,2);
stem(t,x);
axis([0 10 -1 1]);
title('DISCRETE SIN WAVE');xlabel('t-->');ylabel('Amplitude-->');
% GENERATION OF COSINE WAVE
x1=cos(t);
subplot(3,2,3);
plot(t,x1);
title('COS WAVE');xlabel('t-->');ylabel('Amplitude-->');
% GENERATION OF TANGENT WAVE
x2=tan(t);
subplot(3,2,4);
plot(t,x2);
axis([0 15 -3 3]);
title('TANGENT WAVE');xlabel('t-->');ylabel('Amplitude-->');
% GENERATION OF COSEC WAVE
x3=csc(t);
subplot(3,2,5);
plot(t,x3);  axis([0 15 -3 3]);
title('COSEC WAVE');xlabel('t-->');ylabel('Amplitude-->');
% GENERATION OF SEC WAVE
x4=sec(t);
subplot(3,2,6);
stem(t,x4);  axis([0 15 -3 3]);
title('SEC WAVE');xlabel('t-->');ylabel('Amplitude-->');

Figure window

Basic-trigonometry-function
No comments:
Post a Comment

Related Posts Plugin for WordPress, Blogger...