Download Lab Session 01 - NED University

Transcript
Engineering Workshop
Lab Session 22
NED University of Engineering & Technology – Department of Computer & Information Systems Engineering
Lab Session 22
OBJECT
Solving Linear Algebra Problems (polynomial equations)
THEORY



Scalar Operations
Solving Complex Variable
Solving Polynomial Equations
Solving Polynomial Equation:
Representing Polynomial Equation:
For representing polynomial equation in MATLAB we can define a polynomial equation as
follow;
MATLAB Representation [Coefficient
vector]
[1 2 3 4 5]
Actual Polynomial Equation
[1 0 3 0 5]
y = x4 +3x2 +5
[1 2+i 3 4-3i 5i]
y = x4 + (2+i)x3 +3x2 + (4-3i)x +5i
y = x4+2x3+3x2+4x+5
Thus from the above example it is evident that the polynomial equation is represented in terms of
its Coefficient vector. Note in the above example that the missing values of polynomial are
replaced by zeros in the coefficient vector.
Operations on Polynomial
Following are the operations we will discuss in this section in detail.
a)
b)
c)
d)
Addition & Subtraction Operation
Multiplication & Division Operation
Polyval Function
Operation on roots
a) Addition & Subtraction Operation:
Addition and subtraction operation of two polynomials is quite simple using matlab. It`s just
about adding or subtracting the Coefficient vector of two polynomials as illustrated in the
following example
118