Evaluating polynomials in Matlab

  • MATLAB
  • Thread starter qubits135
  • Start date
  • #1
qubits135
2
0
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
194
43
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'.
 
  • Like
Likes FactChecker

Suggested for: Evaluating polynomials in Matlab

  • Last Post
Replies
6
Views
92
  • Last Post
Replies
2
Views
614
  • Last Post
Replies
4
Views
204
Replies
1
Views
445
Replies
10
Views
1K
Replies
1
Views
734
  • Last Post
Replies
9
Views
918
  • Last Post
Replies
2
Views
757
  • Last Post
Replies
1
Views
644
Replies
0
Views
690
Top