comparison scripts/control/system/zp2ss.m @ 4675:f6d6335c08f6

[project @ 2003-12-16 05:11:26 by jwe]
author jwe
date Tue, 16 Dec 2003 05:11:27 +0000
parents cef48c4b902d
children b8105302cfe8
comparison
equal deleted inserted replaced
4674:7736835a5c8e 4675:f6d6335c08f6
49 ## Author: David Clem 49 ## Author: David Clem
50 ## Created: August 15, 1994 50 ## Created: August 15, 1994
51 51
52 function [a, b, c, d] = zp2ss (zer, pol, k) 52 function [a, b, c, d] = zp2ss (zer, pol, k)
53 53
54 save_warn_empty_list_elements = warn_empty_list_elements;
55 unwind_protect
56 warn_empty_list_elements = 0;
57
58 if(nargin != 3) 54 if(nargin != 3)
59 error("Incorrect number of input arguments"); 55 error("Incorrect number of input arguments");
60 endif 56 endif
61 57
62 if(! (isvector(zer) | isempty(zer)) ) 58 if(! (isvector(zer) | isempty(zer)) )
70 ") should be a scalar"]); 66 ") should be a scalar"]);
71 elseif( k != real(k)) 67 elseif( k != real(k))
72 warning("zp2ss: k is complex") 68 warning("zp2ss: k is complex")
73 endif 69 endif
74 70
75 zpsys = ss2sys([],[],[],k); 71 zpsys = ss2sys (zeros (0, 0), zeros (0, 1), zeros (1, 0), k);
76 72
77 ## Find the number of zeros and the number of poles 73 ## Find the number of zeros and the number of poles
78 nzer=length(zer); 74 nzer=length(zer);
79 npol =length(pol); 75 npol =length(pol);
80 76
148 144
149 endwhile 145 endwhile
150 146
151 [a,b,c,d] = sys2ss(zpsys); 147 [a,b,c,d] = sys2ss(zpsys);
152 148
153 unwind_protect_cleanup
154 warn_empty_list_elements = save_warn_empty_list_elements;
155 end_unwind_protect
156
157 endfunction 149 endfunction
158 150