cummulative distribution function plz help

Status
Not open for further replies.

meto

Junior Member level 1
Joined
Apr 9, 2006
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,399
cummulative distribution

I wanna write a script with using matlab, which calculates the cummulative distribution function of the given input but i don't have any idea about this.I know that there is prepared function in matlab (cdf) but I have to write because this is homework.Thanks
 

matlab cummulative distribution function


Consider you generate gaussian random variables x and want to find cdf;

This is the script;

x=randn(10000,1); % generate 10000 gaussian samples

%find maxm of and minimum of x

P=max(x)-min(x);

L=min(x)/1000:max(x);

y=hist(x,L) % generate histogram;

z=cumsum; % cdf

plot(L,z);

that's it

Added after 1 minutes:

Typo

Consider you generate gaussian random variables x and want to find cdf;

This is the script;

x=randn(10000,1); % generate 10000 gaussian samples

%find maxm of and minimum of x

P=max(x)-min(x);


L=min(x)P/1000):max(x);

y=hist(x,L) % generate histogram;

z=cumsum; % cdf

plot(L,z);

that's it
 

cumsum matlab cumulative distribution function

Tthank a lot janath
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…