um wtf? i change it to this. isnt the syntax for takin derivaitiven.. diff?
Code
h = .25;
f = @(x) tan(x);
df = diff(f);
df(1)
tol = 0;
f1 = tol + 10^-10
while f1 > tol
f1 = ( f(1+h) - f(1-h) )/ (2*h)
h = h/2;
end
and it says error
Code
Error using diff
Function 'diff' is not supported for class 'function_handle'.
Error in homework5_1 (line 9)
df = diff(f);