MATLAB Evaluating polynomials in Matlab

  • Thread starter Thread starter qubits135
  • Start date Start date
  • Tags Tags
    Matlab Polynomials
AI Thread Summary
To evaluate polynomials defined symbolically in a system, the subs function is essential for substituting specific values into expressions. For polynomial evaluation, the command polyval can be used, where 'h' represents the coefficients of the polynomial and 'x' is the value at which to evaluate it. While some systems allow defining polynomials similarly to matrices, they often lack advanced manipulation capabilities like integration or differentiation, making traditional symbolic methods more efficient for complex operations.
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 FactChecker

Similar threads

Replies
2
Views
3K
Replies
4
Views
1K
Replies
4
Views
1K
Replies
5
Views
3K
Replies
3
Views
2K
Replies
4
Views
2K
Back
Top