Graphics Reference
In-Depth Information
polyvalm(p, X)
evaluates the polynomial
p
in matrix
X.
[r, p, k] = residue(a, b)
gives the column vectors
r
,
p
and k such that:
b(s)/a(s)=r1/(s-p1)+r2/(s-p2)+…+rn/(s-pn) +k(s)
[b, a] = residue(r, p, k)
performs the reverse of the previous operation.
Then let's look at some examples of these newly defined commands:
Let's decompose the fraction
(-x ^ 2 + 2 x + 1) /(x^2-1)
>> [r,p,k]=residue([-1,2,1],[1,0,-1])
r =
1.0000
1.0000
p =
-1.0000
1.0000
k =
-1
So the decomposition will be:
(-x ^ 2 + 2 x + 1) /(x^2-1) = 1 /(-1+x) + 1 / (x + 1) - 1
The same result can be obtained in the following way:
>> pretty(sym(maple('convert((-x^2+2*x+1)/(x^2-1),parfrac,x)')))
1 1
-1 + ---- + -----
x x + 1
Then we will evaluate the polynomial
x ^ 4-6 * x ^ 3-x ^ 2 + 10 * x-11
about the point
x = 5
and on the matrix
of order 4.
>> polyval([1,-6,-1,10,-11],5)
ans =
-111