Navigation

Operators and Keywords

Function List:

C++ API

residue.m File Reference


Functions

 if (nargin >=3) if(nargin >
 if (la==0||lb==0) k
 elseif (la==1) k
 p (m)
endfor if (lb >=la)[k
 if (isa(a,"single")||isa(b,"single")) small
endif p (abs(p)< small)=0
 p (index)
 if (lp==1) r
 ri (ip)
 A (:, ip)
endif if (nargin< 5) e
endif if numel (e) indx
endfor if (numel(k)) pnum
endif if (isa(r,"single")||isa(p,"single")||isa(k,"single")) small
endif pnum (abs(pnum)< small)=0
 pden (abs(pden)< small)=0
 !assert (abs(r-[-2;7;3])< 1e-12%!&&abs(p-[2;2;1])< 1e-12%!&&isempty(k)%!&&e==[1;2;1])
 !assert ((abs(br-b)< 1e-12%!&&abs(ar-a)< 1e-12))
 !assert ((abs(b-[1,-5, 9,-3, 1])< 1e-12%!&&abs(a-[1,-5, 8,-4])< 1e-12))
 !assert ((abs(rr-r(n))< 1e-12%!&&abs(pr-p(n))< 1e-12%!&&abs(kr-k)< 1e-12%!&&abs(er-e(n))< 1e-12))

Variables

 function [r, p, k, e]
endif toler = .001
else e = []
 endif [r, p] = rresidue (b, a, varargin{1}, toler, e)
return endif a = polyreduce (a)
 b = polyreduce (b)
 la = length (a)
 lb = length (b)
 return
 r = p = e = []
endif p = roots (a)
 lp = length (p)
 p_group = cumsum (e == 1)
for ng
else k = []
endif small = max (abs (p))
 index = (abs (imag (p)) < small)
endif aorder = numel (a) - 1
 border = aorder - 1
 A = zeros (border+1, border+1)
 B = prepad (reshape (b, [numel(b), 1]), border+1, 0)
for ip
 else [e, indx] = mpoles (p, toler, 0)
endif indx = 1:numel(p)
for n
else pden = conv (pden, pn)
endif endfor D = numel (pden) - 1
 K = numel (k) - 1
 N = K + D
 pnum = zeros (1, N+1)
for m
else pm = conv (pm, p1)
endif endfor pn = deconv (pden, pm)
endfunction!test !b = [1, 1, 1]
 !a = [1, -5, 8, -4]
 !k = [1 0]
 !r1 = residue (b, a) [-5i
 !p1 = [+3i
!test !r = [7
 !p = [2
 !e = [2

Function Documentation

!assert ( (abs(rr-r(n))< 1e-12%!&&abs(pr-p(n))< 1e-12%!&&abs(kr-k)< 1e-12%!&&abs(er-e(n))< 1e-12)   ) 

!assert ( (abs(b-[1,-5, 9,-3, 1])< 1e-12%!&&abs(a-[1,-5, 8,-4])< 1e-12)   ) 

!assert ( (abs(br-b)< 1e-12%!&&abs(ar-a)< 1e-12)   ) 

!assert (  ) 

A ( ,
ip   
)

elseif ( la  = =1  ) 

endif if ( isa(r,"single")||isa(p,"single")||isa(k,"single")   ) 

endfor if ( numel(k  ) 

endif if (  ) 

if ( lp  = =1  ) 

if ( isa(a,"single")||isa(b,"single")   ) 

endfor if ( lb >=  la  ) 

if ( la  = =0||lb==0  ) 

if ( nargin >=  3  ) 

endif if numel ( e   ) 

p ( index   ) 

endif p (  )  [pure virtual]

p (  ) 

pden (  )  [pure virtual]

endif pnum (  )  [pure virtual]

ri ( ip   ) 


Variable Documentation

!a = [1, -5, 8, -4]

!test !b = [1, 1, 1]

!e = [2

!k = [1 0]

!p = [2

!p1 = [+3i

!test !r = [7

!r1 = residue (b, a) [-5i

A = zeros (border+1, border+1)

a = polyreduce (a)

endif aorder = numel (a) - 1

B = prepad (reshape (b, [numel(b), 1]), border+1, 0)

endfor b = polyreduce (b)

border = aorder - 1

endif endfor D = numel (pden) - 1

else e = []

else[e, indx] = mpoles (p, toler, 0)

endif[r, p] = rresidue (b, a, varargin{1}, toler, e)

endfunction function[pnum, pden, e]

Initial value:

 residue (b, a, varargin)

  if (nargin < 2 || nargin > 4)
    print_usage ()

error index = (abs (imag (p)) < small)

endif indx = 1:numel(p)

Initial value:

 1:numel(p)
    ri = zeros (size (p))

K = numel (k) - 1

else k = []

la = length (a)

lb = length (b)

lp = length (p)

for m

Initial value:

 1:e(n)
      if (m == 1)
        pm = p1

N = K + D

for n

Initial value:

 indx
    pn = [1, -p(n)]

Initial value:

 1:p_group(end)
    m = find (p_group == ng)

p = roots (a)

p_group = cumsum (e == 1)

pden = conv (pden, pn)

else pm = conv (pm, p1)

pn = deconv (pden, pm)

pnum = zeros (1, N+1)

r = p = e = []

return

else small = max (abs (p))

endif toler = .001