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

Home » Public Forums » archive » Applying scalar functions to 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
Applying scalar functions to arrays [message #10437] Thu, 04 December 1997 00:00 Go to previous message
vaever is currently offline  vaever
Messages: 3
Registered: November 1997
Junior Member
How can you apply an IDL scalar function to each element in an
array, without using for loops?

Suppose we have the following array:

IDL> a=[0.05,0.01,0.001]

Calculating cosine is easy!
IDL> print,cos(a)
0.998750 0.999950 1.00000

But how about chi-square quantiles...?
IDL> print,chisqr_cvf(a,17)
% Compiled module: CHISQR_CVF.
% Expression must be a scalar in this context: <BYTE Array[3]>.
% Error occurred at: CHISQR_CVF 49
/usr/local/rsi/idl_5/lib/chisqr_cvf.pro
% $MAIN$
% Execution halted at: $MAIN$


The manual instructs you to avoid for loops when operating on
arrays, but doesn't tell you how! Can anyone help?

Niels

--
Niels Vaever Petersen tlf.: 8942 3494
Afd. f. Teoretisk Statistik e-mail: vaever@mi.aau.dk
Aarhus Universitet kontor: G3.19
[Message index]
 
Read Message
Read Message
Previous Topic: window iconify???
Next Topic: axis and the like

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

Current Time: Fri Oct 10 14:26:26 PDT 2025

Total time taken to generate the page: 1.20155 seconds