how to plot cumulative normal distribution of matlab

조회 수: 20 (최근 30일)
Sajid Afaque
Sajid Afaque 2020년 6월 8일
댓글: Bjorn Gustavsson 2020년 6월 8일
i have a data "z_hist" which i have enclosed below.
now i need to plot cumulative normal distribution which looks something like below image
where my x-axis would be range from min(z_hist) to max(z_hist).
how do i plot it.
any help would be appreciated.

답변 (1개)

Bjorn Gustavsson
Bjorn Gustavsson 2020년 6월 8일
If you have the statistics toolbox you have direct access to the cummulative distribution of a number of pdfs. Try to look at the help and documentation for normcdf, and you will see:
normcdf Normal cumulative distribution function (cdf).
P = normcdf(X,MU,SIGMA) returns the cdf of the normal distribution
If you don't have the statistics toolbox you will have to figure out how to calculate it yourself - which should be very simple since matlab gives you the error-functions. See for example: Normal ditribution.
HTH
  댓글 수: 2
Sajid Afaque
Sajid Afaque 2020년 6월 8일
do i need to take mean and standard deviation of my data. i.e z_hist.
once i calculate p,how do i plot is to get above graph
Bjorn Gustavsson
Bjorn Gustavsson 2020년 6월 8일
Before doing anything like that, you first need to take a look at your data. Do something like this:
subplot(2,1,1)
plot(z)
subplot(2,1,2)
hist(z,40)
Then have a think about how your data fits with respect to a normal-distribution and what you might need to do next (check that you have the right data perhaps?).
HTH

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

제품


릴리스

R2013b

Community Treasure Hunt

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

Start Hunting!

Translated by