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

Home » Public Forums » archive » Re: replace array's elemets
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: replace array's elemets [message #35158] Sat, 17 May 2003 15:15 Go to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
Reimar Bauer wrote:
...
>>> Roberto wrote:
>>>
>>>> Hi
>>>> I have a 100x100 array.
>>>> How can I replace an element if is different from 0?
>>>> I would replace all elements different from 0 with 1.
>>>> thank and sorry for the trouble.
>>>> Roberto
...
> print,(abs(x)<1)

That works only as long as 'x' is an integer array, which may have been
the case. It won't do the right thing x is a floating point array
containing some values between 0.0 and 1.0. However, even for integer
arrays, I would expect "x ne 0" to be the faster solution.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: plotting from high values to low values
Next Topic: read pixels

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

Current Time: Wed Oct 08 15:54:11 PDT 2025

Total time taken to generate the page: 0.00362 seconds