Skip to Main Content
Programming in MATLAB ®: A Problem-Solving Approach by Pearson
book

Programming in MATLAB ®: A Problem-Solving Approach by Pearson

by Ram N. Patel, Ankush Mittal
May 2024
Intermediate to advanced content levelIntermediate to advanced
433 pages
13h 7m
English
Pearson India
Content preview from Programming in MATLAB ®: A Problem-Solving Approach by Pearson
Polynomial Functions É 153
5.6 Polynomial Functions
In MATLAB, a polynomial is represented by a vector. To create a polynomial in MATLAB,
simply enter each coefficient of the polynomial into the vector in descending order. For instance,
consider the following polynomial:
fx xx
xx
1315
29
43 2
()=+ −−+
To enter this into MATLAB, just enter it as a vector in the following manner:
>> f1x = [1 3 -15 -2 9]
f1x = 1 3 -15 -2 9
MATLAB interprets a vector of length n + 1 as an nth order polynomial. Thus, if a polynomial
is missing any coefficients, one must enter zeros in the appropriate place in the vector. For
example, if
fx
xx22
42
()=+
, then it would be represented in MATLAB as
fx
2(
)
= [1 0 2 0 0].
The value of a polynomial f(x) can be evaluated at x = k using ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Applied Numerical Methods Using MATLAB, 2nd Edition

Applied Numerical Methods Using MATLAB, 2nd Edition

Won Y. Yang, Wenwu Cao, Jaekwon Kim, Kyung W. Park, Ho-Hyun Park, Jingon Joung, Jong-Suk Ro, Han L. Lee, Cheol-Ho Hong, Taeho Im
MATLAB Recipes: A Problem-Solution Approach

MATLAB Recipes: A Problem-Solution Approach

Michael Paluszek, Stephanie Thomas
Practical MATLAB Deep Learning: A Projects-Based Approach

Practical MATLAB Deep Learning: A Projects-Based Approach

Michael Paluszek, Stephanie Thomas, Eric Ham

Publisher Resources

ISBN: 9781306983440Publisher Website