how do you make a function out of a graph

4 views (last 30 days)
I got the x points and the y points, so basically a graph. I need to make a function y(x) out of it. I know it is more of a math question but hoped I could get some help anyway. Thanks in advance.
  1 Comment
Stephen23
Stephen23 on 24 Nov 2017
@Mohammed Rauf: there are infinite possible functions that exactly fit any finite set of data points. Which of those infinite functions do you want?
You basically have a choice between:
  1. you know something about the underlying physical process and have a mathamtical model, in which case search for "MATLAB curve fitting".
  2. you do not know the underlying physical process or it is too complex, in which case search for "MATLAB splines".

Sign in to comment.

Accepted Answer

dpb
dpb on 24 Nov 2017
See <Parametric Fitting> . It's essentially finding a rational model that fits the data; if you know something about underlying physics that can help derive a functional form that's all to the good.
If purpose is building a model, then the above is pretty-much the toolset; if the purpose is to simply interpolate existing data then splines or least-squares smoothing splines may be useful.
Begin, of course, by plotting the data to see what it looks like...

More Answers (0)

Categories

Find more on Spline Postprocessing in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!