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

Home » Public Forums » archive » make all array values equal to zero
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: make all array values equal to zero [message #89861 is a reply to message #89857] Thu, 11 December 2014 07:58 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 12/11/14, 8:12 am, g.nacarts@gmail.com wrote:
> Hi
>
> Can I use the "greater than" operator to make all array values
> greater than 100 equal to zero?
>
> E.g. A = [[1,2,3],[120,4,200]] to become A = [[1,2,3],[0,4,0]]
>
> Many Thanks
>

In addition to the other methods mentioned:

IDL> print, (A le 100) * A
1 2 3
0 4 0

And, if you really want to know if there was some way to do it with
greater than operator, yes you can:

IDL> print, (1B - (A gt 100)) * A
1 2 3
0 4 0

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: plot positional degrees
Next Topic: Rendering method software vs hardware

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

Current Time: Wed Oct 08 17:04:20 PDT 2025

Total time taken to generate the page: 0.00462 seconds