Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Ax=b problems...

Subject: Ax=b problems...

From: eric

Date: 6 Dec, 2012 08:42:13

Message: 1 of 4

1. polyfit(x,y,N)
About this one, I am confused about N. What decides N value?

2. what is fminsearch for? take an example...

Subject: Ax=b problems...

From: eric

Date: 6 Dec, 2012 08:49:15

Message: 2 of 4

"eric " <liangz4@uw.edu> wrote in message <k9plp5$gai$1@newscl01ah.mathworks.com>...
> 1. polyfit(x,y,N)
> About this one, I am confused about N. What decides N value?
>
> 2. what is fminsearch for? take an example...

one more question:
what is norm for? I saw err=norm(...)^2



Thank you very much

Subject: Ax=b problems...

From: Jos (10584)

Date: 6 Dec, 2012 14:09:08

Message: 3 of 4

"eric " <liangz4@uw.edu> wrote in message <k9plp5$gai$1@newscl01ah.mathworks.com>...
> 1. polyfit(x,y,N)
> About this one, I am confused about N. What decides N value?
>
> 2. what is fminsearch for? take an example...

The documentation and help within matlab is pretty good. Try it!

help polyfit
doc fminsearch

~ Jos

Subject: Ax=b problems...

From: Steven_Lord

Date: 6 Dec, 2012 14:43:32

Message: 4 of 4



"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

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us