필터 지우기
필터 지우기

how to generate and plot uniform distributions?

조회 수: 8 (최근 30일)
Qasim Manzoor
Qasim Manzoor 2013년 11월 28일
댓글: Shubham 2024년 3월 23일
i need to generate twenty uniform distributions and plot one of them to get the plot of a uniform probability distribution.

답변 (1개)

Wayne King
Wayne King 2013년 11월 28일
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
Shubham
Shubham 2024년 3월 23일
A = 2;
B = 5;
meas = B-A;
X = 2:0.01:5;
y = 1/meas*ones(size(X));
plot(X,y)

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by