Question: what should I change in my matlab code myapproximatederivative(f,a,t) which takes three inputs: f: A function handle. a: A real number Note: You may assume
what should I change in my matlab code
myapproximatederivative(f,a,t) which takes three inputs: f: A function handle. a: A real number Note: You may assume that f'(a) exists. Does: Uses a while loop to calculate 1/2 1/3 1/4 until successive values differ by less than t. Returns: The final calculated value. function r - myapproximatederivative(f,a,t) h 1i oldapprox- (f (ath)-f (a))/h; h = h/2; approx = (f(ath )-f(a))/h; while (abs (approx-oldapprox)>=t) oldapprox = approx ; h=h/2; approx = (f(a+h )-f(a))/h; end r = approx; end
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
