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

Home » Public Forums » archive » Re: subset a 2d array
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: subset a 2d array [message #61939] Wed, 13 August 2008 20:19
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
xiao writes:

> For example, i hava an array like this:
>
> 13, 14, 15, 16, 17
> 23, 24, 25,26, 27
> 2, 4 , 5, 66 ,7
> 13, 14, 15, 16, 17
> 13, 14, 15, 16, 17
>
> i know the center value is 5 .Then i want to subset the array to 3*3
> and 5 is still the center. Just subset like this :
>
> 24, 25,26
> 4 , 5, 66
> 14, 15, 16,
>
> Any one has good ideas how can i do that?

How about something like this:

subarray = array[1:3, 1:3]

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: subset a 2d array
Next Topic: Re: Problem with multi plot

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

Current Time: Wed Oct 08 17:26:18 PDT 2025

Total time taken to generate the page: 0.00442 seconds