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

Home » Public Forums » archive » Help
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: Help [message #15543 is a reply to message #5724] Fri, 21 May 1999 00:00 Go to previous messageGo to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
Tri VU KHAC wrote:
>
> Hi folks,
>
> I'm looking for an efficient way to produce the matrix of type (I woulk
> like to be able to avoid the FOR statement)
>
> 0 1 0 1 0 1 0 1
> 1 0 1 0 1 0 1 0
> 0 1 0 1 0 1 0 1
> 1 0 1 0 1 0 1 0
>
> OR
>
> 1 0 0 1 0 0 1
> 0 1 0 0 1 0 0
> 0 0 1 0 0 1 0
> 1 0 0 1 0 0 1
>
> ETC.
>
> Best regards,
> Tri.


Isn't that coincidence? Take a look at the recent discussion on "AN
array slicing function". I posted a routine ARREX that will do the
opposite of what you are looking for, i.e. you could extract all the 1's
from your matrix with it (probably need several calls though). Now you
can go ahead and use the function arrex_ComputeInd (included in
arrex.pro) to come up with a function arrexi that returns the indices
rather than the values, and then you would write

A = intarr(8,4)
A[arrexi(A,[1,0],-1,[2,2]) = 1
A[arrexi(A,[0,1],-1,[2,2]) = 1

(or similar) ... If you wait a little, I'll hack arrexi for you as soon
as soem other folks have confirmed that arrex works.

Regards,
Martin.


--

|||||||||||||||\\\\\\\\\\\\\-------------------///////////// //|||||||||||||||
Martin Schultz, DEAS, Harvard University, 29 Oxford St., Pierce 109,
Cambridge, MA 02138 phone (617) 496 8318 fax (617) 495 4551
e-mail mgs@io.harvard.edu web http://www-as/people/staff/mgs/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Point data
Next Topic: JOIN POINTS IN A PLOT

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

Current Time: Fri Oct 10 15:24:19 PDT 2025

Total time taken to generate the page: 0.24283 seconds