diff scripts/control/system/zp2sys.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
line wrap: on
line diff
--- a/scripts/control/system/zp2sys.m	Mon Feb 16 16:22:43 2004 +0000
+++ b/scripts/control/system/zp2sys.m	Mon Feb 16 17:45:50 2004 +0000
@@ -55,93 +55,9 @@
 
 ## Modified by John Ingram  July 20, 1996
 
-function outsys = zp2sys (zer, pol, k, tsam, inname, outname)
-
-  ## Test for the correct number of input arguments
-  if ((nargin < 3) || (nargin > 6))
-    usage("outsys = zp2sys(zer,pol,k[,tsam,inname,outname])");
-  endif
-
-  ## check input format
-  if( ! (isvector(zer) | isempty(zer) ) )
-    error("zer must be a vector or empty");
-  endif
-  if(!isempty(zer))
-    zer = reshape(zer,1,length(zer));           # make it a row vector
-  endif
-
-  if( ! (isvector(pol) | isempty(pol)))
-    error("pol must be a vector");
-  endif
-  if(!isempty(pol))
-    pol = reshape(pol,1,length(pol));
-  endif
-
-  if (! isscalar(k))
-     error("k must be a scalar");
-  endif
-
-  ## Test proper numbers of poles and zeros.  The number of poles must be
-  ## greater than or equal to the number of zeros.
-  if (length(zer) >  length(pol))
-    error(["number of poles (", num2str(length(pol)), ...
-        ") < number of zeros (", num2str(length(zer)),")"]);
-  endif
-
-  ## Set the system transfer function
-  outsys.zer = zer;
-  outsys.pol = pol;
-  outsys.k = k;
-
-  ## Set the system vector:  active = 1, updated = [0 1 0];
-  outsys.sys = [1, 0, 1, 0];
+function outsys = zp2sys ( varargin )
 
-  ## Set defaults
-  outsys.tsam = 0;
-  outsys.n = length(pol);
-  outsys.nz = 0;
-  outsys.yd = 0;        # assume (for now) continuous time outputs
-
-  ## Set the type of system
-  if (nargin > 3)
-    if( !isscalar(tsam) )
-      error("tsam must be a nonnegative scalar");
-    endif
-    if (tsam < 0)
-      error("sampling time must be positve")
-    elseif (tsam > 0)
-      [outsys.n,outsys.nz] = swap(outsys.n, outsys.nz);
-      outsys.yd = 1;            # discrete-time output
-    endif
-
-    outsys.tsam = tsam;
-  endif
-
-  outsys.inname = __sysdefioname__ (1, "u");
-  outsys.outname = __sysdefioname__ (1, "y");
-  outsys.stname = __sysdefstname__ (outsys.n, outsys.nz);
-
-  ## Set name of input
-  if (nargin > 4)
-    ## make sure its a string
-    if(!isempty(inname))
-      if(!islist(inname))  inname = list(inname); endif
-      if(!is_signal_list(inname))
-        error("inname must be a single signal name");
-      endif
-      outsys.inname = inname(1);
-    endif
-  endif
-
-  ## Set name of output
-  if (nargin > 5)
-    if(!isempty(outname))
-      if(!islist(outname))        outname = list(outname);    endif
-      if(!is_signal_list(outname))
-        error("outname must be a single signal name");
-      endif
-      outsys.outname = outname(1);
-    endif
-  endif
+  warning("zp2sys is deprecated.  Use zp() instead.");
+  outsys = zp(varargin{:});
 
 endfunction