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.

回答 (2 件)

the cyclist
the cyclist 2011 年 11 月 24 日

0 投票

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

0 投票

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).

カテゴリ

ヘルプ センター および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

質問済み:

2011 年 11 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by