From: Sheng-Yun on
"debi mishra" <debi_sit(a)yahoo.co.in> wrote in message <ef02eab.1(a)webx.raydaftYaTP>...
> Peter Perkins wrote:
> >
> >
> > debi mishra wrote:
> >
> >> I want to find "multivariate normal distribution sample" from
> M
> > and
> >> V.
> >
> > If you have the Statistics Toolbox:
> > r = mvnrnd(M,V,n);
> >
> > If not:
> > r = repmat(M,n,1) + randn(n,length(M))*chol(V);
> >
> > Hope this helps.
> >
> > - Peter Perkins
> > The MathWorks, Inc.
> >
>
> I have Statistics Toolbox.But from your reply i cannot understand
> what to write in place of 'n' in the command
> mvnrnd.So please help.
> Thank you

Dear Peter,
Because I did not get statistics toolbox, I tried r = repmat(M,n,1) + randn(n,length(M))*chol(V). However Matlab gave me a warning:
??? Error using ==> plus
Matrix dimensions must agree.
Would you please tell me what I should do? Thank you.

Nathalie
From: Peter Perkins on
Sheng-Yun wrote:

> Dear Peter,
> Because I did not get statistics toolbox, I tried r = repmat(M,n,1) + randn(n,length(M))*chol(V). However Matlab gave me a warning:
> ??? Error using ==> plus
> Matrix dimensions must agree.
> Would you please tell me what I should do? Thank you.

The error message tells you exactly what the problem is, and where it is happening. Evaluete the two halves of the expression, look at their sizes, and figure out what you've done wrong.
From: Tom Lane on
> Because I did not get statistics toolbox, I tried r = repmat(M,n,1) +
> randn(n,length(M))*chol(V). However Matlab gave me a warning:
> ??? Error using ==> plus
> Matrix dimensions must agree.
> Would you please tell me what I should do? Thank you.

Nathalie, I don't know what values all these variables have for you, but
this code is appropriate when M is defined as a row vector rather than a
column vector. Make sure that's true. If that's not the problem, I'd have to
know the value of n and the sizes of M and V.

-- Tom


 | 
Pages: 1
Prev: cbir
Next: need a different "contourc"-algorithm