comparison scripts/control/system/sys2tf.m @ 4771:b8105302cfe8

[project @ 2004-02-16 17:45:50 by jwe]
author jwe
date Mon, 16 Feb 2004 17:45:50 +0000
parents 22bd65326ec1
children bdbee5282954
comparison
equal deleted inserted replaced
4770:ef5e598f099b 4771:b8105302cfe8
18 18
19 ## -*- texinfo -*- 19 ## -*- texinfo -*-
20 ## @deftypefn {Function File} {[@var{num}, @var{den}, @var{tsam}, @var{inname}, @var{outname}] =} sys2tf (@var{sys}) 20 ## @deftypefn {Function File} {[@var{num}, @var{den}, @var{tsam}, @var{inname}, @var{outname}] =} sys2tf (@var{sys})
21 ## Extract transfer function data from a system data structure 21 ## Extract transfer function data from a system data structure
22 ## 22 ##
23 ## See tf2sys for parameter descriptions. 23 ## See tf for parameter descriptions.
24 ## 24 ##
25 ## @strong{Example} 25 ## @strong{Example}
26 ## @example 26 ## @example
27 ## octave:1> sys=ss2sys([1 -2; -1.1,-2.1],[0;1],[1 1]); 27 ## octave:1> sys=ss([1 -2; -1.1,-2.1],[0;1],[1 1]);
28 ## octave:2> [num,den] = sys2tf(sys) 28 ## octave:2> [num,den] = sys2tf(sys)
29 ## num = 1.0000 -3.0000 29 ## num = 1.0000 -3.0000
30 ## den = 1.0000 1.1000 -4.3000 30 ## den = 1.0000 1.1000 -4.3000
31 ## @end example 31 ## @end example
32 ## @end deftypefn 32 ## @end deftypefn
41 if(nargin != 1) 41 if(nargin != 1)
42 usage("[num,den,tsam,inname,outname] = sys2tf(Asys)"); 42 usage("[num,den,tsam,inname,outname] = sys2tf(Asys)");
43 endif 43 endif
44 44
45 if( !isstruct(Asys)) 45 if( !isstruct(Asys))
46 error("Asys must be a system data structure (see ss2sys, tf2sys, zp2sys)"); 46 error("Asys must be a system data structure (see ss, tf, zp)");
47 elseif (! is_siso(Asys) ) 47 elseif (! is_siso(Asys) )
48 [n, nz, m, p] = sysdimensions(Asys); 48 [n, nz, m, p] = sysdimensions(Asys);
49 error(["system is not SISO (",num2str(m)," inputs, ... 49 error(["system is not SISO (",num2str(m)," inputs, ...
50 ", num2str(p)," outputs"]); 50 ", num2str(p)," outputs"]);
51 endif 51 endif