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 Exchange에서 Get 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