3 %
function testing the powervectors and its derivatives, i.e. check
4 % whether finite difference approximates the derivative.
6 % Bernard Haasdonk 28.8.2009
17 D = power_vector2_derivative(x,p);
19 d1 = (power_vector2(x+[h,0],p)-power_vector2(x,p))/h;
20 d2 = (power_vector2(x+[0,h],p)-power_vector2(x,p))/h;
24 maxerr = max(max(abs(Dappr-D)));
25 % disp([
'p = ',num2str(p),
', maxerr =',num2str(maxerr)]);