Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Idl-pvware > Re: Huh?? Stdde...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 5 Topic 5644 of 5919
Post > Topic >>

Re: Huh?? Stddev went crazy!

by "mgalloy@[EMAIL PROTECTED] " <mgalloy@[EMAIL PROTECTED] > Apr 16, 2008 at 12:34 PM

On Apr 16, 1:27=A0pm, Bruce Bowler <bbow...@[EMAIL PROTECTED]
> wrote:
> On Wed, 16 Apr 2008 12:07:29 -0700, Conor wrote:
> > I'd like to see someone explain this one. =A0My stddev function
apparent=
ly
> > lost all grasp on reality?
>
> > IDL> print,stddev([1,2,3,4,5])
> > =A0 =A0 =A0 3.07421 =A0 =A0 =A03.24566 =A0 =A0 =A03.08206 =A0 =A0
=A03.2=
6360 =A0 =A0 =A02.97446
> > IDL> print,stddev([1.,2.,3.,4.,5.])
> > =A0 =A0 =A0 3.07421 =A0 =A0 =A03.24566 =A0 =A0 =A03.08206 =A0 =A0
=A03.2=
6360 =A0 =A0 =A02.97446
> > IDL> print,stddev([1.,2.])
> > =A0 =A0 =A0 3.07421 =A0 =A0 =A03.24566
>
> Did you perhaps have an array named stddev?

That would cause the behavior you are seeing: IDL can't tell the
difference between indexing the stddev array or calling the stddev
function. The fix is to use

  compile_opt strictarr

at the beginning of every routine you write (which will force you to
never use parentheses for indexing arrays). You can also put it in a
startup file to eliminate mixups on the command line (probably more
common).

Mike
--
www.michaelgalloy.com
Tech-X Cor****ation
Software Developer II
 




 5 Posts in Topic:
Huh?? Stddev went crazy!
Conor <cmancone@[EMAIL  2008-04-16 12:07:29 
Re: Huh?? Stddev went crazy!
Bruce Bowler <bbowler@  2008-04-16 19:27:11 
Re: Huh?? Stddev went crazy!
pgrigis@[EMAIL PROTECTED]  2008-04-16 12:31:30 
Re: Huh?? Stddev went crazy!
"mgalloy@[EMAIL PROT  2008-04-16 12:34:04 
Re: Huh?? Stddev went crazy!
Conor <cmancone@[EMAIL  2008-04-16 12:41:52 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 5 14:50:25 CDT 2008.