Evaluating polynomials in Matlab

  • MATLAB
  • Thread starter qubits135
  • Start date
  • #1
2
0

Main Question or Discussion Point

I defined x as a syms, then work with polynomials involving x. But then I can't find an evaluation command for these polynomials at some x value. Anyone knows how I can get it to work? Thank you in advance.

There's another system where you can define polynomials just like matrices, e.g. x^2+1 as [1 0 1]. But they only have elementary manipulation, and it becomes really cumbersome doing integral or derivative. (that was why I went the traditional way, which is the one mentioned above).

Thanx
 

Answers and Replies

  • #3
osilmag
Gold Member
117
25
The command polyval(h,x), where 'h' is a vector of the coefficients of an nth degree polynomial, evaluates a polynomial at each point 'x'.
 

Related Threads for: Evaluating polynomials in Matlab

Replies
4
Views
4K
  • Last Post
Replies
4
Views
2K
  • Last Post
Replies
0
Views
3K
Replies
1
Views
3K
Replies
1
Views
11K
  • Last Post
Replies
1
Views
1K
Replies
1
Views
996
Replies
2
Views
6K
Top