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

Home » Public Forums » archive » step function
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: step function [message #76764 is a reply to message #76760] Tue, 05 July 2011 07:33 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 7/5/11 4:07 am, sid wrote:
> Hi all,
> Is there a standard programme for using step function in idl.
> If so please let me know.
> thank you
> Sid

You can use the comparison operators directly (maybe with some
arithmetic). Like:

y = x gt 5.

This makes the value of y be 1. for values of x greater than 5. and 0.
otherwise (i.e., less than or equal to 5.). If you don't want the value
of the step-function to be 0. and 1., then use some arithmetic:

y = (x gt 5) * (large_value - small_value) + small_value

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL, A Guide to Learning IDL: http://modernidl.idldev.com
Research Mathematician
Tech-X Corporation
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: netnews for reading this group
Next Topic: Type conversion error: Unable to convert given STRING to Float.

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

Current Time: Sat Oct 11 15:46:01 PDT 2025

Total time taken to generate the page: 0.63950 seconds