Defining an arbitrary polynomial
조회 수: 12 (최근 30일)
이전 댓글 표시
I am writing a function and it has to work for any polynomial so I was wondering how I could write a code that represents all polynomials
댓글 수: 0
답변 (2개)
Friedrich
2012년 2월 16일
Hi,
have a look at the polynomial function from MATLAB:
In general you store the coefficients only, so the vector [3,2,1] would represent 3x^2+2x+1. The rest can be done with the function from MATLAB, e.g. polyval
댓글 수: 0
Walter Roberson
2012년 2월 16일
The Symbolic Math Toolbox has DOM_poly, objects of type 'polynomial', and there is the MuPAD-level function poly() to construct such objects. The facilities include the ability to designate the ring over which the arithmetic is to be done, so you can (for example) construct a polynomial over (say) GF(4), Galois Field 4. The routine Friedrich referred you to is for real-valued polynomials only and so is not suitable for your goal of writing code that represents all polynomials
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Polynomials에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!