How to fit points to a curve?

Hi. I´m fairly new at using matlab and I´m having some troubles with an exercise from my book.
I´m supposed to write a small program where I can enter a number of points and fit an exponential curve of an arbitrary degree to those points.
It feels like I´m too inexperienced to do such a thing but apparently I´m supposed to be able to after 2 weeks of taking the course. Any help would be great. Thanks.

Antworten (2)

the cyclist
the cyclist am 24 Nov. 2011

0 Stimmen

Do you have access to the Statistics Toolbox? If so, you could use the expfit() command.
Njöng
Njöng am 24 Nov. 2011

0 Stimmen

Nope, I´m pretty sure we´re not allowed to use it. We´re not even allowed to use polyfit :/
The only method I can think of is writing a bunch of commandos that do the job for me.
Eg. if I had x=[1 2 3 4] and y=[5 6 7 8] I´d have to write a program that fits those points to a curve of a polynomial whose degree < length(x).

Kategorien

Mehr zu Get Started with Curve Fitting Toolbox finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 23 Nov. 2011

Community Treasure Hunt

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

Start Hunting!

Translated by