comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: realizing the formula in idl
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: realizing the formula in idl [message #45400 is a reply to message #45399] Fri, 09 September 2005 07:14 Go to previous messageGo to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
pravesh.subramanian@gmail.com wrote:
> Hello,
> How do I realize this formula in IDL?
>
> matrix(x, y) = 1/(s^2 * 2 * pi) * Exp (-(x^2 + y^2)/2 * s^2)
>
> let's say x = y = 300

The other people who've responded have assumed that what you mean is
that matrix is a 300x300 array, and that you want to fill in the entire
array. That seems likely, but there's an alternative interpretation of
your message, for which the answer is different. If you merely want to
set one element of the array to this value, then what you've already
written is almost exactly the correct IDL translation:

matrix[x, y] = 1/(s^2 * 2 * !dpi) * Exp (-(x^2 + y^2)/2 * s^2)

Even the use of the square brackets "[]" isn't strictly necessary, I
just think it's clearer.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: error bars
Next Topic: How to create an image from the last columns of a stack of images?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 02:49:43 PDT 2025

Total time taken to generate the page: 0.55532 seconds