Question: Numerical differentiation Write a function Difference to calculate the central difference, forward difference and backward diference approximation to a function within a given range of



Numerical differentiation Write a function Difference to calculate the central difference, forward difference and backward diference approximation to a function within a given range of xmin:xinc:xmax. The input arguments of the function Difference is the handle to an anonymous function, a row array xmin:xinc:xmax. The differences should be returned as a row array, calculated at xmin:xinc:xmax. Restriction: Loops may not be used. For example: func @(x) x.3; xmin=3 ; xnc-025; xmax=4 ; [backDifference, cent raLDifference, backDifference = forwardDifference] Derivative (func, xmin, xmax, xinc) = 24.8125 29.3125 34.1875 39.4375 45.0625 27.0625 31.7500 36.8125 42.2500 48.0625 29.3125 34.1875 39.437545.0625 51.0625 centraLDiffe rence- forwardDifference
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
