Question: Develop a MATLAB function which numerically computers using a forward, backward, or centrat amerience derivative. The function accepts 4 Inputs: An arbitrary vector An arbitrary
Develop a MATLAB function which numerically computers using a forward, backward, or centrat amerience derivative. The function accepts 4 Inputs: An arbitrary vector An arbitrary y vector The location index) in the vector at which to computer A string delimiter for the type of derivative. 'Fforward difference, 'b' backwards difference, and ca central difference. You may find the stremo function handy The output You may assume that . You will only compute a single derivative every time the function is called (ie, dis a scalar) always exists at the specified point (le we will never ask you to compute a backwards difference at the first data point). de dy ds To test your code, use the following linspace(1, 10, 10); This means to compute the forward difference at the 5th element in the x vector. You should get yds - yo) y(5)/(6) *(5)) (6-3)/(0-5) - 11
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
