Suppose I have a set of points xi = {x0,x1,x2,...xn} and corresponding function values fi = f(xi) = {f0,f1,f2,...,fn}, how to find derivative

2 ビュー (過去 30 日間)
PJS KUMAR
PJS KUMAR 2018 年 9 月 7 日
回答済み: Bjorn Gustavsson 2018 年 9 月 7 日
Suppose I have a set of points xi = {x0,x1,x2,...xn} and corresponding function values fi = f(xi) = {f0,f1,f2,...,fn}, where f(x) is, in general, an unknown function. (In some situations, we might know f(x) ahead of time, but we want to do this generally, since we often don't know f(x) in advance.) What's a good way to approximate the derivative of f(x) at each point xi? That is, how can I estimate values of dfi == d/dx fi == df(xi)/dx at each of the points xi?

回答 (1 件)

Bjorn Gustavsson
Bjorn Gustavsson 2018 年 9 月 7 日
Surely this is homework/introductory exercise?
  1. Have a look at the definition of derivative.
  2. Think about what you can achieve in terms of approximating that from your set of points.
  3. Have a look at functions for converting your set of points to arrays and how to sort arrays - look at the help for: cell2mat, sort.
  4. Think about how to run the difference and division operations on arrays - look up the difference between matrix division (and multiplication) and elementwise division and multiplication.
After doing this reading--understanding-learning this task will become trivial.
HTH

カテゴリ

Help Center および File ExchangeShifting and Sorting Matrices についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by