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

Home » Public Forums » archive » Inverting indices?
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: Inverting indices? [message #2448 is a reply to message #2353] Wed, 29 June 1994 13:26 Go to previous messageGo to previous message
robijn is currently offline  robijn
Messages: 18
Registered: June 1994
Junior Member
In article <kkobayas.772907009@husc9.harvard.edu>,
Ken Kobayashi <kkobayas@husc9.harvard.edu> wrote:
>
> Am I making sense? I just need to do j=OPPOSITE(i,10) so that when
> i=[1,3,5] it'll return j=[0,2,4,6,7,8,9].
>
> I couldn't find a built-in routine that does this. I tried the following
> code:
>
> FUNCTION opposite,idx,n
> k = bytarr(n)
> k(idx)=1
> return,where(not k)
> end
>
> but this didn't seem to work for some reason.

A 'false' value in IDL is -1, not 1. So change k(idx)=1 to k(idx)=-1 and
it will work.

Frank
--
_____ ____
/ / / Frank Robijn Internet: Robijn@Strw.LeidenUniv.NL
/___ /___/ Sterrewacht Leiden Bitnet: Robijn@HLERUL51
/ / \ Phone (31) 71 275841 Local: Robijn@HL628
/ / \ Fax : (31) 71 275819 Snail: P.O.Box 9513, 2300 RA Leiden,
The Netherlands
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: simultaneous run
Next Topic: Annotating Radar Images

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

Current Time: Fri Oct 10 13:18:40 PDT 2025

Total time taken to generate the page: 0.96234 seconds