|
"eric " <liangz4@uw.edu> wrote in message
news:k9plp5$gai$1@newscl01ah.mathworks.com...
> 1. polyfit(x,y,N)
> About this one, I am confused about N. What decides N value?
You decide the degree of the polynomial that you want to fit. There are
limitations, of course. You shouldn't choose N to be greater than the number
of data points minus 1 (if you do, the polynomial isn't unique) and you
shouldn't choose N to be bigger than you really need. While you _could_ fit
a 100 degree polynomial to 101 data points, keep in mind that's going to
require raising each of your x values to the 100th power and you're almost
certain to end up with an ill-conditioned system.
> 2. what is fminsearch for? take an example...
See the documentation; it contains several examples of how to use
FMINSEARCH.
http://www.mathworks.com/help/matlab/ref/fminsearch.html
If after reading that and running the examples step-by-step you still have
specific questions, feel free to post them.
--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com
|