Sunday 28 October 2012

Program for Normal Distribution using CDF

Here is a program of MAT LAB for normal distribution N(mu,sigma) using CDF.
CDF stands for Cumulative Density Function.

open MAT LAB open new script and paste this program :-

Program :-
-----------------------------------------------------------------------------------------------------------------------


mu=100;
sigma=15;
xmin=70;
xmax=130;
n=100;
k=10000;
x=linspace(xmin,xmax,n);
c=normcdf(x,mu,sigma);
plot(x,c);
xlabel('x');
ylabel('cdf');
title('cumulative density function');

-----------------------------------------------------------------------------------------------------------------------

just paste the program, press run.

Output :-





IF YOU HAVE ANY QUERY THAN CONTACT US OR GIVE YOUR QUERY IN THE QUERY OPTION.      
                                                            GOOD LUCK

More embedded projects >>....                             More MAT LAB projects>>...


Program for Normal Distribution using PDF

Here is a program of MAT LAB for normal distribution N(mu,sigma) using PDF.
PDF stands for Probability Density Function.

open MAT LAB open new script and paste this program :-

Program :-
-----------------------------------------------------------------------------------------------------------------------


mu=100;
sigma=15;
xmin=70;
xmax=130;
n=100;
k=10000;
x=linspace(xmin,xmax,n);
p=normpdf(x,mu,sigma);
plot(x,p);
xlabel('y');
ylabel('pdf');
title('probability density function');

-----------------------------------------------------------------------------------------------------------------------


just paste the program, press run. :-

Output :-

IF YOU HAVE ANY QUERY THAN CONTACT US OR GIVE YOUR QUERY IN THE QUERY OPTION.      
                                                            GOOD LUCK

More embedded projects >>....                             More MAT LAB projects>>...



Histogram of Random Number Distribution

Here is a program for random number distribution from N(mu,sigma).  (HISTOGRAM)

open MAT LAB open new script and paste this program :-

Program :-

-----------------------------------------------------------------------------------------------------------------------



mu=100;
sigma=15;
k=10000;
y=normrnd(mu,sigma,k,1);
%subplot(133);
hist(y,20);
xlabel('y');
ylabel('frequency');
title('histogram of random values');

-----------------------------------------------------------------------------------------------------------------------

just paste the program, press run.

Output :-




IF YOU HAVE ANY QUERY THAN CONTACT US OR GIVE YOUR QUERY IN THE QUERY OPTION.      
                                                            GOOD LUCK

More embedded projects >>....                             More MAT LAB projects>>...


Generation of Random signal

Here is a program of MAT LAB for generation of random signals in continuous and discreet form.

open MAT LAB open new script and paste this program :-

Program :-
-----------------------------------------------------------------------------------------------------------------------


n=input('enter yhe value of n=');
x=rand(1,n);
subplot(211);
stem(x);
ylabel('amp.');
xlabel('time');
title('dis. random signal');


subplot(212);
plot(x);
ylabel('amp.');
xlabel('time');
title('cont. random signal');

-----------------------------------------------------------------------------------------------------------------------

just paste the program, press run, enter the value of 'n' (numerical). get output :-

Output :-

Note :-
              output will be different every time because it is a random signal

IF YOU HAVE ANY QUERY THAN CONTACT US OR GIVE YOUR QUERY IN THE QUERY OPTION.      
                                                            GOOD LUCK

More embedded projects >>....                             More MAT LAB projects>>...



Program for Addition & Subtraction of two signals

Here is a program of MAT LAB for addition & subtraction of two signals in continuous and discreet form.

open MAT LAB open new script and paste this program :-

Program :-
-----------------------------------------------------------------------------------------------------------------------


n=input('enter the value of n=');
t=0:0.005:n;
f=1;


x=sin(2*pi*f*t);
y=cos(2*pi*f*t);
z=x+y;
z1=x-y;


subplot(321);
plot(t,x);
ylabel('amp.');
xlabel('time');
title('cont. sine wave');


subplot(322);
plot(t,y);

ylabel('amp.');
xlabel('time');
title('cont. cosine wave');


subplot(323);
plot(t,z);
ylabel('amp.');
xlabel('time');
title('cont. addition wave');


subplot(324);
plot(t,z1);
ylabel('amp.');
xlabel('time');
title('cont. subtraction wave');


subplot(325);
stem(t,z);
ylabel('amp.');
xlabel('time');
title('dis. addition wave');


subplot(326);
stem(t,z1);
ylabel('amp.');
xlabel('time');
title('dis. subtraction wave');

-----------------------------------------------------------------------------------------------------------------------

just paste the program, press run, enter the value of 'n' (numerical). get output :-

Output :-

IF YOU HAVE ANY QUERY THAN CONTACT US OR GIVE YOUR QUERY IN THE QUERY OPTION.      
                                                            GOOD LUCK

More embedded projects >>....                             More MAT LAB projects>>...


Program for Convolution of two signals

Here is a program for convolution of two signals in MAT LAB in continuous and discreet form.

open MAT LAB open new script and paste this program :-

Program :-

-----------------------------------------------------------------------------------------------------------------------


n=input('enter the value of n=');
t=0:0.02:n;
f=1;

x1=sin(2*pi*f*t);
subplot(321);
plot(t,x1);
ylabel('amp.');
xlabel('time');
title('cont. sine wave');


subplot(323);
stem(t,x1);
xlabel('time');
ylabel('amp.');
title('dis. sine wave');

y1=cos(2*pi*f*t);
subplot(322);
plot(t,y1);
xlabel('time');
ylabel('amp.');
title('cont. cosine wave');

subplot(324);
stem(t,y1);
xlabel('time');
ylabel('amp.');
title('dis. cosine wave');

z1=conv(x1,y1);
subplot(325);
plot(z1);
xlabel('time');
ylabel('amp.');
title('cont. time convolution');

subplot(326);
stem(z2);
xlabel('time');
ylabel('amp.');
title('dis. time convolution');

-----------------------------------------------------------------------------------------------------------------------

just paste the program, press run, enter the value of 'n' (numerical). get output :-

Output :-

IF YOU HAVE ANY QUERY THAN CONTACT US OR GIVE YOUR QUERY IN THE QUERY OPTION.      
                                                            GOOD LUCK

More embedded projects >>....                             More MAT LAB projects>>...




Generation of Exponential & Ramp signal

Here is a program for generation of exp. and ramp Signal in MAT LAB in continuous and discreet form.

open MAT LAB open new script and paste this program :-

Program :-

-----------------------------------------------------------------------------------------------------------------------


n=input('enter the value of n=');
t=0:0.5:n;
x=exp(t);
subplot(221);
plot(x);
ylabel('amp.');
xlabel('time');
title('cont. exp signal');

subplot(222);
stem(x);
ylabel('amp.');
xlabel('time');
title('dis. exp signal');

y=t;
subplot(223);
plot(y);
ylabel('amp.');
xlabel('time');
title('cont. ramp signal');

subplot(224);
stem(y);
ylabel('amp.');
xlabel('time');
title('dis. ramp signal');

-----------------------------------------------------------------------------------------------------------------------

just paste the program, press run, enter the value of 'n' (numerical). get output :-

Output :-



IF YOU HAVE ANY QUERY THAN CONTACT US OR GIVE YOUR QUERY IN THE QUERY OPTION.      
                                                            GOOD LUCK

More embedded projects >>....                             More MAT LAB projects>>...


Program for Unit Step Signal

Here is a program for generation of Unit Step Signal in MAT LAB in continuous and discreet form.

open MAT LAB open new script and paste this program :-

Program :-

-----------------------------------------------------------------------------------------------------------------------

n=input('enter any integer value = ');
t=1
x=ones(t,n);
subplot(211);
plot(x);
ylabel('amp.');
xlabel('time');
title('cont. unit step signal');

subplot(212);
stem(x);
ylabel('amp.');
xlabel('time');
title('dis. unit step signal');

-----------------------------------------------------------------------------------------------------------------------

just paste the program, press run, enter the value of 'n' (numerical). get output :-

Output :-




IF YOU HAVE ANY QUERY THAN CONTACT US OR GIVE YOUR QUERY IN THE QUERY OPTION.      
                                                            GOOD LUCK

More embedded projects >>....                             More MAT LAB projects>>...

Program for elementary signals

Here is a program of MAT LAB for displaying elementary signals like sine and cosine waves in continuous and discreet form.

open MAT LAB open new script and paste this program :-

Program :-
-----------------------------------------------------------------------------------------------------------------------
n=input('enter the value of n=');
t=0:0.02:n;
f=1;
x=sin(2*pi*f*t);
subplot(221);
plot(t,x);
ylabel('amp.');
xlabel('time');
title('cont. sine wave');


subplot(222);
stem(t,x);
xlabel('time');
ylabel('amp.');
title('dis. sine wave');

y=cos(2*pi*f*t);
subplot(223);
plot(t,y);
xlabel('time');
ylabel('amp.');
title('cont. cosine wave');

subplot(224);
stem(t,y);
xlabel('time');
ylabel('amp.');
title('dis. cosine wave');

-----------------------------------------------------------------------------------------------------------------------

just paste the program, press run, enter the value of 'n' (numerical). get output :-

Output :-







IF YOU HAVE ANY QUERY THAN CONTACT US OR GIVE YOUR QUERY IN THE QUERY OPTION.      
                                                            GOOD LUCK

More embedded projects >>....                             More MAT LAB projects>>...