File: sci_ss2tf.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 (41 lines) | stat: -rw-r--r-- 850 bytes parent folder | download | duplicates (2)
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
39
40
41
function [stk,txt,top]=sci_ss2tf()
// Copyright INRIA
txt=[]
[DEN,NUM]=lhsvarsnames()
if rhs==4 then
  a=stk(top-3)(1)
  b=stk(top-2)(1)
  c=stk(top-1)(1)
  d=stk(top)(1)
  iu='1'
else
  a=stk(top-4)(1)
  b=stk(top-3)(1)
  c=stk(top-2)(1)
  d=stk(top-1)(1)
  iu=stk(top)(1)
end
if ~isname(b) then
  b1=gettempvar(1)
  txt=[txt;b1+' = '+b]
  b=b1
end
b=b+'(:,'+iu+')'
if ~isname(d) then
  d1=gettempvar(2)
  txt=[txt;d1+' = '+d]
  d=d1
end
Ds=gettempvar(3)
d=d+'(:,'+iu+')'
txt=[txt;
    '%sm=simp_mode();simp_mode(%f)'
    '['+makeargs([Ds,NUM,DEN])+']  = ss2tf(syslin(''c'','+makeargs([a,b,c,d])+'))';
    DEN+' = '+DEN+'(1)';
    NUM+' = coeff('+NUM+',0:degree('+DEN+'))'
    NUM+' = '+NUM+'(:,$:-1:1)'
    DEN+' = coeff('+DEN+')'
    DEN+' = '+DEN+'($:-1:1)';
    'simp_mode(%sm)']
stk=list(list('?','-2','1','?','?'),list('?','-2','1','?','?'))