Probablity distribution calculation for a vector

조회 수: 2 (최근 30일)
Niki
Niki 2014년 8월 21일
댓글: Adam 2014년 8월 21일
I want to use the following function Y = normpdf(X,mu,sigma)
X is a vector of 100*1 for each X I have a mu and a sigma , do you know how to do that ?
  댓글 수: 3
Niki
Niki 2014년 8월 21일
yes
Adam
Adam 2014년 8월 21일
So what is the problem? You have a vector X, a vector mu and a vector sigma and a function that expects all these as inputs.

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

답변 (1개)

Roger Stafford
Roger Stafford 2014년 8월 21일
From the documentation for normpdf at
http://www.mathworks.com/help/stats/normpdf.html
"Y = normpdf(X,mu,sigma) computes the pdf at each of the values in X using the normal distribution with mean mu and standard deviation sigma. X, mu, and sigma can be vectors, matrices, or multidimensional arrays that all have the same size. A scalar input is expanded to a constant array with the same dimensions as the other inputs. The parameters in sigma must be positive."
That should answer your question.
  댓글 수: 1
Niki
Niki 2014년 8월 21일
Thanks but I knew this, my question is something different from what you just said

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

Community Treasure Hunt

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

Start Hunting!

Translated by