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

Home » Public Forums » archive » Newcomer to IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Newcomer to IDL [message #94337] Thu, 13 April 2017 17:19 Go to previous message
asmagal89 is currently offline  asmagal89
Messages: 2
Registered: April 2017
Junior Member
Hello!

I would like to know why the following procedure, taken ipsis verbis from the Harris example does not compile without errors:

QUOTE

PRO agfunct, X, A, F, pder
bx=EXP(A[1]*X)
  F=A[0]*bx+A[2]
;If the procedure is called with four parameters, calculate the
;partial derivatives.
 IF N_PARAMS() GE 4 THEN $
  pder=[[bx], [A[0] * X * bx], [replicate(1.0, N_ELEMENTS(X))]]
END
;Compute the fit to the function we have just defined.
;First, define the independent and dependent variables:
X = FLOAT(INDGEN(10))
Y = [12.0, 11.0, 10.2, 9.4, 8.7, 8.1, 7.5, 6.9, 6.5, 6.1]
;Define a vector of weights.
weights = 1.0/Y
;Provide an initial guess of the function’s parameters.
A = [10.0,-0.1,2.0]
;Compute the parameters.
yfit = CURVEFIT(X, Y, weights, A, SIGMA, FUNCTION_NAME='agfunct')
;Print the parameters returned in A.
PRINT, 'Function parameters: ', A
END

UNQUOTE

Thanks in advance,
Antonio.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Interpolate whole array instead of looping through elements
Next Topic: save cgBlendImage as eps?

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

Current Time: Wed Oct 08 09:18:32 PDT 2025

Total time taken to generate the page: 0.00364 seconds