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

Home » Public Forums » archive » Re: Help: how to do ?
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: how to do ? [message #15281 is a reply to message #15269] Tue, 04 May 1999 00:00 Go to previous message
Pavel Romashkin is currently offline  Pavel Romashkin
Messages: 166
Registered: April 1999
Senior Member
Tri VU KHAC wrote:

> Hi folks,
>
> Having 2 arrays:
> + 3x1 : A1 = findgen(1, 3)
> + 3xN: A2= findgen(N, 3)
>
> No I need to do sth like:
>
> for i=1, N do A[i,*] = A2[i,*] + A1
>
> How to avoid FOR-DO here ?

a1 = [[a1], fltarr(n-1, 3)]
a = a2+a1

I clocked the (100x1000) array. This method is 10 times faster than a
loop.
Cheers,
Pavel
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Experimental FAQ
Next Topic: New procedure to plot great circles on a map

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

Current Time: Fri Oct 10 08:03:45 PDT 2025

Total time taken to generate the page: 0.87837 seconds