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

Home » Public Forums » archive » cutting/grouping
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: cutting/grouping [message #85774 is a reply to message #85773] Thu, 05 September 2013 14:39 Go to previous messageGo to previous message
Heinz Stege is currently offline  Heinz Stege
Messages: 189
Registered: January 2003
Senior Member
Hi Seb,

I have absolutely no knowledge about R. The following may help you, or
may not. Look for the value_locate function in the IDL documentation.
It can reproduce the results of your R calculation:

IDL> a=indgen(10)+1
IDL> b=indgen(6)*2
IDL> pos=value_locate(b,a)
IDL> pos-=b[pos] eq a
IDL> print,b[pos]
0 0 2 2 4
4 6 6 8 8
IDL> print,'('+strtrim(b[pos],2)+','+strtrim(b[pos+1],2)+']'
(0,2] (0,2] (2,4] (2,4] (4,6] (4,6] (6,8] (6,8] (8,10] (8,10]
IDL> u=uniq(pos)
IDL> print,'('+strtrim(b[pos[u]],2)+','+strtrim(b[pos[u]+1],2)+'] '
(0,2] (2,4] (4,6] (6,8] (8,10]

Cheers, Heinz
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: overplots with two different y axes
Next Topic: graphics window

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

Current Time: Fri Oct 10 15:11:50 PDT 2025

Total time taken to generate the page: 1.44224 seconds