From: Alfian Abdul Halin on 29 Apr 2010 00:57 Works GREAT Theodoros! Alhamdulillaah Thanks! Alfian "Theodoros Giannakopoulos" <tyiannak(a)hotmail.com> wrote in message <fc0v9o$276$1(a)fred.mathworks.com>... > "sp " <corrilow(a)mathworks.com> wrote in message > <fc0rth$t0f$1(a)fred.mathworks.com>... > > Hi all > > > > I am new to matlab.. I have data x which consists of 700 > > values for altitude.. I have also found the mean and > > standard deviation for x.. > > > > > > Can I find out how to plot a probability density function > > for x with a normal distribution?? > > > > Thanks! > > > > > > Corri > > Hi. You can use normpdf() function. For example, let A your > array of values, and M, S your mean and standard deviation > values respectively. > Normpdf() has 3 arguments: > x: the values on which the pdf will be calculated > m: the mean value > s: the std value. > > Therefore for our example you could write: > > >> A = rand(700,1); > >> MAX = max(A); > >> STD = std(A); > >> MAX = max(A); > >> MIN = min(A); > >> STEP = (MAX - MIN) / 1000; > >> PDF = normpdf(MIN:STEP:MAX, M, S); > >> plot(MIN:STEP:MAX, PDF); > > Regards, > Theodore > > --------------------------------- > www.di.uoa.gr/~tyiannak > --------------------------------- > >
|
Pages: 1 Prev: Figure out image filter frequency in cycles/ph? Next: image registration |