Question: Use known values for using alongside a procedure


I have a set of points defined for XX[j] and YY[j] where j=1..16,

I'm beginning to write a loop for these values and I was wondering how to get the actual numerical values in to say the following...

GX := proc (j)
local YY, XX, G;
G := (1/2)*(YY[j]-YY[j-1])^2/(XX[j]-XX[j-1])+(1/2)*(YY[j+1]-YY[j])^2/(XX[j+1]-XX[j]);
diff(G, XX[j]) end proc;

Then - for example - for GX(4), this gives an output in terms of XX[4], XX[5], etc but I'd like it to give a numerical answer.. how do  I get it to sub the real values in?

Any help would be much appreciated,



Please Wait...