Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help me with this question by using matlab to successfully run it.Plase add the comments Thank you for your help 1. [40 Points Write
Please help me with this question by using matlab to successfully run it.Plase add the comments Thank you for your help
1. [40 Points Write a script that determines the first and second derivatives of a function that is given by a set of discrete points with equal spacing. The input arguments are vectors with the coordinates of the points, and the output arguments are vectors with the values of the first and second derivatives, respectively, at each point. For calculating both derivatives, the function should use the finite difference formulas that have a truncation error of O(h?). The script should also produce a plot of a function, and both of the derivatives. Use the developed script for calculating the derivatives of the function that is given by the following set of points -0.5 1.5 -1 0.5 2.5 3.5 4.5 f(x) -3.632 -0.3935 1 0.6487 -1.282 -4.518 -8.611 -12.82 -15.91 -15.88 -9.402 9.017 Show finite difference approximations that you used (formulas) Plot function and both derivatives on three sub-plots
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started