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 
Return to the default flat view Create a new topic Submit Reply
Re: subset a 2d array [message #61938 is a reply to message #61937] Wed, 13 August 2008 20:22 Go to previous message
xiao zhang is currently offline  xiao zhang
Messages: 81
Registered: June 2008
Member
On Aug 13, 10:19 pm, David Fanning <n...@dfanning.com> wrote:
> 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.")
hmmm... The problem is I have a array like 240*500. And all the
values are different. And I do not know the row and column. I only
know the center value should be 2.5 . Then ,how can I do that? :)
Thank you~
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: how to preserve trailing Shallow dimensions!
Next Topic: Need help with an Iterative solution in IDL (relative newb question)

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

Current Time: Sun Oct 12 02:15:14 PDT 2025

Total time taken to generate the page: 2.15922 seconds