Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: randn usage error
Date: Wed, 4 Nov 2009 14:42:03 +0000 (UTC)
Organization: The MathWorks Inc
Lines: 28
Message-ID: <hcs3rr$bph$1@fred.mathworks.com>
References: <hcs392$4ve$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257345723 12081 172.30.248.38 (4 Nov 2009 14:42:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 4 Nov 2009 14:42:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1597503
Xref: news.mathworks.com comp.soft-sys.matlab:582388


"Vijayalayan T.R." <xcitingindian@yahoo.com> wrote in message <hcs392$4ve$1@fred.mathworks.com>...
> Hello all,
> 
> This is my first post so if its in an inappropriate section, my apologies.
>  So this is the situation, I'm working on my postgrad project which involves locating a cell phone and I use Time Difference of Arrival with wavelet denoising filtering. I came across someone else's work which is similar to mine but in a diff technology. So I took up to study his code to get an idea of what I'm supposed to do.
> 
> In this test program.
> this line is not working
> 
> randn('state', 2*(i+j));
>         noi1_real=sqrt(pow/(2*oran))*randn(1,1024);
> 
> And the error is
> ??? Error using ==> randn
> State must be a double scalar or the output of RANDN('state').
> 
> Error in ==> tez5 at 36
>         randn('state', t);
> 
> Can anyone throw some light on what I'm supposed to do. 
> 
> Thanks in advance
> 
> Cheers
> Vi

Hi, what are i and j equal to? If you don't assign these in your code, then by default they will be the complex number 0 + 1.0000i and you will get the above error.
Wayne