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

Home » Public Forums » archive » Multiple parameters for ZEROFCN
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: Multiple parameters for ZEROFCN [message #78985 is a reply to message #78899] Sun, 15 January 2012 07:57 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
I give an example of using common blocks to pass parameters below. Since IDL does not have the PV_WAVE ZEROFCN function, I substituted ZBRENT just to have a function that works for me.

Note that another limitation of the built-in IMSL/Numerical Recipes functions in IDL is that the user-supplied function must return a *scalar* value. So be careful that your extra Y parameter is also a scalar. --Wayne


FUNCTION f, x
common fparam, y
RETURN, X^3 + y
END

pro test
common fparam,y

FOR i = 0, 9 DO BEGIN
Y = i
print, Zbrent(-5,5,func_name="F")
ENDFOR
END
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Creating procedure with arbitrary number of input parameters
Next Topic: Where is where?

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

Current Time: Sat Oct 11 01:41:44 PDT 2025

Total time taken to generate the page: 0.24181 seconds