Evaluating polynomials in Matlab

  • Context: MATLAB 
  • Thread starter Thread starter qubits135
  • Start date Start date
  • Tags Tags
    Matlab Polynomials
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 4K views
qubits135
Messages
2
Reaction score
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
 
Physics news on Phys.org
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   Reactions: FactChecker