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 #85777 is a reply to message #85774] Thu, 05 September 2013 21:15 Go to previous messageGo to previous message
Seb is currently offline  Seb
Messages: 15
Registered: January 2006
Junior Member
On Thu, 05 Sep 2013 23:39:47 +0200,
Heinz Stege <public.215.967@arcor.de> wrote:

> 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 b=indgen(6)*2 pos=value_locate(b,a) 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]

Thanks, this is a great tool. I see though that it's limited to cases
where 'a' increases monotonically.

Cheers,
--
Seb
[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: Sun Oct 12 02:26:37 PDT 2025

Total time taken to generate the page: 0.23844 seconds