Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Curve / data fit

Subject: Curve / data fit

From: Lucas campos

Date: 28 May, 2010 17:12:12

Message: 1 of 4

Hi there,

I need some help in fitting data to a curve.

I have a curve (x,y) but I do not have the equation that generates that curve. I have only a set of points x,y.

What I need is some function or strategy that will give me an approximated 'y' in function of any given x.

Could someone send me suggestions?

Thanks a lot

Subject: Curve / data fit

From: Matt J

Date: 28 May, 2010 17:19:10

Message: 2 of 4

"Lucas campos" <campos.lucas@gmail.com> wrote in message <htothc$sie$1@fred.mathworks.com>...

> What I need is some function or strategy that will give me an approximated 'y' in function of any given x.
>
> Could someone send me suggestions?
=============

Buy the Curve Fit toolbox? Or search "curve fit" on the FEX for many options.

Subject: Curve / data fit

From: Walter Roberson

Date: 28 May, 2010 17:33:03

Message: 3 of 4

Lucas campos wrote:

> I need some help in fitting data to a curve.
>
> I have a curve (x,y) but I do not have the equation that generates that
> curve. I have only a set of points x,y.
>
> What I need is some function or strategy that will give me an
> approximated 'y' in function of any given x.

polyfit() will give you a result no less "correct" as any other in this
situation.


As I wrote in another thread yesterday,

"There is not (and cannot be) a unique or meaningful answer unless you
already know the form the formula should take. Think of your known X, Y,
and Z as fixed physical points and think of there being elastic sheets
connecting all of the points to their neighbours: you can pinch or
stretch any of the elastic sheets an infinite number of ways, and each
different way represents a different possible formula that completely
explains the data. If you do not have some knowledge ahead of time that
constrains the possibilities, you have no way of saying that any of the
infinite number of formula are more correct than any of the others, and
the probability that you will hit upon the correct formula would be 0."

Subject: Curve / data fit

From: Steven Lord

Date: 28 May, 2010 17:33:44

Message: 4 of 4


"Lucas campos" <campos.lucas@gmail.com> wrote in message
news:htothc$sie$1@fred.mathworks.com...
> Hi there,
>
> I need some help in fitting data to a curve.
>
> I have a curve (x,y) but I do not have the equation that generates that
> curve. I have only a set of points x,y.
>
> What I need is some function or strategy that will give me an approximated
> 'y' in function of any given x.
>
> Could someone send me suggestions?

Do you want the actual equation or do you just want to interpolate for a
given y?

For the former, look at Curve Fitting Toolbox or the other functions listed
in this document:

http://www.mathworks.com/support/tech-notes/1500/1508.html

For the latter, look at INTERP1.

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us