File: plzr.sci

package info (click to toggle)
scilab 2.4-1
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 55,196 kB
  • ctags: 38,019
  • sloc: ansic: 231,970; fortran: 148,976; tcl: 7,099; makefile: 4,585; sh: 2,978; csh: 154; cpp: 101; asm: 39; sed: 5
file content (38 lines) | stat: -rw-r--r-- 854 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
function plzr(a,b,c,d)
//
// Copyright INRIA
[lhs,rhs]=argn(0)

//-compat type(a)==15 retained for list/tlist compatibility
if type(a)==15|type(a)==16 then
  if rhs<>1 then error(39),end
  a1=a(1);
  select a1(1)
    case 'lss' then [a,b,c,d]=a(2:5)
    case 'r' then a=tf2ss(a),[a,b,c,d]=a(2:5)
    else error(97,1)
  end;
end;
dr=spec(a)
[al,be]=tr_zer(a,b,c,d)
nr=al./be
ni=imag(nr);nr=real(nr)
di=imag(dr);dr=real(dr)
mx=maxi([nr;dr;1;ni;di]*1.1)
mn=mini([nr;dr;-1;ni;di]*1.1)
xselect();
isoview(mn,mx,mn,mx);
xx=xget("mark")
xset("mark",xx(1),xx(1)+1);
if prod(size(nr))<>0 then
  plot2d(nr,ni,[-9,-1],"101",'Zeros')
end;
plot2d([mn;mx],[0;0],[4],"000",' ')
plot2d([0;0],[mn;mx],[4],"000",' ')
plot2d(dr,di,[-2,-2],"101",'Poles');
xarc(-1,1,2,2,0,360*64)
xtitle('transmission zeros and poles','real axis','imag. axis');
xset("mark",xx(1),xx(2));