Filter löschen
Filter löschen

About uniform distribution pdf.....

4 Ansichten (letzte 30 Tage)
rathod ujjval rameshbhai
rathod ujjval rameshbhai am 23 Aug. 2015
Kommentiert: Torsten am 25 Aug. 2015
I am trying to plot PDF of uniform distribution.... have problem in plotting pdf..
my code is as follows...
a=0;
b=2;
x=rand(1000,1);
y=unifpdf(x,a,b);
Plot(x,y)....
I know the mistake is in plotting ... i mean instade of x in plot what should i do ?
plot should be .5 till for (0,2) and 0 elsewhere........
  9 Kommentare
rathod ujjval rameshbhai
rathod ujjval rameshbhai am 24 Aug. 2015
Bearbeitet: rathod ujjval rameshbhai am 24 Aug. 2015
Done..... thanks a lot Torsten.... But waht about rand()? Because linespace will generate values in sequence....
Torsten
Torsten am 25 Aug. 2015
unifpdf does only plot the analytically given PDF of the uniform distribution within a certain range. It does not work on randomly generated data or something similar.
If you want to plot the empirical CDF, you will have to use "histogram".
Best wishes
Torsten.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by