1
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
2
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
4
<LANGUAGE>eng</LANGUAGE>
6
<TYPE>Scilab Function</TYPE>
7
<DATE>August 1993</DATE>
8
<SHORT_DESCRIPTION name="numdiff"> numerical gradient estimation</SHORT_DESCRIPTION>
10
<CALLING_SEQUENCE_ITEM>g=numdiff(fun,x [,dx]) </CALLING_SEQUENCE_ITEM>
15
<PARAM_NAME>fun</PARAM_NAME>
17
<SP>: an external, Scilab function or list. See below for calling sequence, see also external for details about external functions.</SP>
21
<PARAM_NAME>x</PARAM_NAME>
23
<SP>: vector, the argument of the function <VERB>fun</VERB></SP>
27
<PARAM_NAME>dx</PARAM_NAME>
29
<SP>: vector, the finite difference step. Default value is <VERB>dx=sqrt(%eps)*(1+1d-3*abs(x))</VERB></SP>
33
<PARAM_NAME>g</PARAM_NAME>
35
<SP>: vector, the estimated gradient</SP>
42
given a function <VERB>fun(x)</VERB> from R^n to R^p
43
computes the matrix <VERB>g</VERB> such as</P>
54
using finite difference methods.</P>
56
The function fun calling sequence must be <VERB>y=fun(x,p1,p2,..pn)</VERB>.If
57
parameters <VERB>p1,p2,..pn</VERB> exist then <VERB>numdiff</VERB> can be called as
58
follow g=numdiff(list(fun,p1,p2,..pn),x).</P>
62
function f=myfun(x,y,z,t)
67
g=numdiff(list(myfun,3,4,2),1)