How to fit points to a curve?

10 visualizzazioni (ultimi 30 giorni)
Njöng
Njöng il 23 Nov 2011
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.

Risposte (2)

the cyclist
the cyclist il 24 Nov 2011
Do you have access to the Statistics Toolbox? If so, you could use the expfit() command.

Njöng
Njöng il 24 Nov 2011
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).

Categorie

Scopri di più su Get Started with Curve Fitting Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by