Borrar filtros
Borrar filtros

how to generate and plot uniform distributions?

8 visualizaciones (últimos 30 días)
Qasim Manzoor
Qasim Manzoor el 28 de Nov. de 2013
Comentada: Shubham el 23 de Mzo. de 2024
i need to generate twenty uniform distributions and plot one of them to get the plot of a uniform probability distribution.

Respuestas (1)

Wayne King
Wayne King el 28 de Nov. de 2013
If you have the Statistics Toolbox -- unifpdf()
For example, U(2,5)
X = 2:0.01:5;
A = 2;
B = 5;
y = unifpdf(X,A,B);
plot(X,y)
but uniform distributions should be very easy to construct without the Statistics Toolbox, the probability density is just constant with value 1/(interval length)
A = 2;
B = 5;
meas = B-A;
X = 2:0.01:5;
y = 1/meas*ones(size(X));
plot(X,y)
  1 comentario
Shubham
Shubham el 23 de Mzo. de 2024
A = 2;
B = 5;
meas = B-A;
X = 2:0.01:5;
y = 1/meas*ones(size(X));
plot(X,y)

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by