Derive equation from set of data

7 views (last 30 days)
I feel rather silly asking this as I'm sure it's extremly simple and that I'm missing a button or something but can't find the answer so thought I'd ask you fine folk for some help :D
I've got two sets of data (y and x) in vector form. I can plot them easy enough but I want to find an equation for the graph those sets of data produce. Like I said I expect it's actually really simple to do... but for the life of me I can't work it out :s
Help is (as always) much appretiated :D

Accepted Answer

Walter Roberson
Walter Roberson on 16 Mar 2012
There are literally an infinite number of equations that would fit the data perfectly. There is no mathematical way to say that one of them is "right" and the others are "wrong"; one of them is as good as any other.
Unless, that is, you already know what the form of the equation has to be. If you know the form of the equation, it might be possible to use curve fitting (such as from the Curve Fitting Toolbox) to optimize the parameters of the curve for a good fit.
Note: A polynomial fit of degree 10 or more is almost certainly a numerical mistake. Even 10 is quite dubious.
  1 Comment
Stephen
Stephen on 16 Mar 2012
I'm now trying the polyfit. Basicly it's a short amount of points that make up the outside of a NACA aerofoil (so when it's run it plots the shape of the aerofoil). There are already formula for doing that, HOWEVER I'm also wanting to do it with flap deflection for which I can't find any formula. So I'm using a program which will give me the points to plot and I'm trying to get an equation which fits so that I can use that in my code to do some calculations.

Sign in to comment.

More Answers (0)

Categories

Find more on Mathematics 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!