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

Home » Public Forums » archive » Re: Need efficient routine to calculate max of two arrays
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: Need efficient routine to calculate max of two arrays [message #3427 is a reply to message #3426] Tue, 24 January 1995 18:45 Go to previous messageGo to previous message
kommers is currently offline  kommers
Messages: 3
Registered: January 1995
Junior Member
> In article <3g3p8i$1o6@cobra.aer.com>, gallery@aer.com (William O. Gallery) writes:
> |> Here is the problem:
> |>
> |> There are two arrays: a and b of equal length, I want to calculate
> |> an array c of the same length so that:
> |> c(i) = min(a(i),b(i))

I think the < and > operators implement this functionality efficiently.
For example:

IDL> a = [5,4,3,2,1]
IDL> b = [1,2,3,4,5]
IDL> c = a < b
IDL> print, c
1 2 3 2 1

The < operator does the "min" part, and > does the "max" part.
For more info, see under "operators" in the User's Guide.

Cheers,

Jeff
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: emacs and IDL (typos in URLs)
Next Topic: floating pt. sliders....

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

Current Time: Fri Oct 10 09:34:05 PDT 2025

Total time taken to generate the page: 1.44225 seconds