How to fit points to a curve?

10 次查看(过去 30 天)
Njöng
Njöng 2011-11-23
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.

回答(2 个)

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

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

类别

Help CenterFile Exchange 中查找有关 Get Started with Curve Fitting Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by