changeset 7134:ff0b965b65bc

[project @ 2007-11-08 16:36:06 by jwe]
author jwe
date Thu, 08 Nov 2007 16:36:06 +0000
parents 1d0d7be2d0f8
children 8aa770b6c5bf
files scripts/ChangeLog scripts/control/obsolete/dezero.m scripts/control/obsolete/dlqg.m scripts/control/obsolete/minfo.m scripts/control/obsolete/packsys.m scripts/control/obsolete/qzval.m scripts/control/obsolete/rotg.m scripts/control/obsolete/series.m scripts/control/obsolete/swapcols.m scripts/control/obsolete/swaprows.m scripts/control/obsolete/syschnames.m scripts/control/obsolete/unpacksys.m
diffstat 12 files changed, 97 insertions(+), 91 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -12,12 +12,18 @@
 	* control/hinf/h2syn.m, control/hinf/hinf_ctr.m,
 	control/hinf/hinfnorm.m, control/hinf/hinfsyn.m,
 	control/hinf/hinfsyn_chk.m, control/hinf/is_dgkf.m,
-	control/hinf/wgt1o.m, control/util/__outlist__.m,
-	control/util/__zgpbal__.m, control/util/axis2dlim.m,
-	control/util/prompt.m, control/util/sortcom.m,
-	control/util/zgfmul.m, control/util/zgfslv.m,
-	control/util/zginit.m, control/util/zgreduce.m,
-	control/util/zgrownorm.m, control/util/zgscal.m: Style fixes.
+	control/hinf/wgt1o.m, control/obsolete/dezero.m,
+	control/obsolete/dlqg.m, control/obsolete/minfo.m,
+	control/obsolete/packsys.m, control/obsolete/qzval.m,
+	control/obsolete/rotg.m, control/obsolete/series.m,
+	control/obsolete/swapcols.m, control/obsolete/swaprows.m,
+	control/obsolete/syschnames.m, control/obsolete/unpacksys.m,
+	control/util/__outlist__.m, control/util/__zgpbal__.m,
+	control/util/axis2dlim.m, control/util/prompt.m,
+	control/util/sortcom.m, control/util/zgfmul.m,
+	control/util/zgfslv.m, control/util/zginit.m,
+	control/util/zgreduce.m, control/util/zgrownorm.m,
+	control/util/zgscal.m: Style fixes.
 
 2007-11-08  David Bateman  <dbateman@free.fr>
 
--- a/scripts/control/obsolete/dezero.m
+++ b/scripts/control/obsolete/dezero.m
@@ -31,7 +31,7 @@
 function t = dezero (s)
 
   ## delete the next line if you're stubbornly going to use dezero.
-  error("dezero is no longer supported.");
+  error ("dezero is no longer supported.");
 
   if (nargin != 1)
     print_usage ();
@@ -48,7 +48,7 @@
 
       ## need to remove zeros first, then call deblank
       s = toascii (s);
-      t = deblank(char(s(find(s != 0) )));
+      t = deblank (char (s(find (s != 0))));
     endif
 
   else
--- a/scripts/control/obsolete/dlqg.m
+++ b/scripts/control/obsolete/dlqg.m
@@ -49,32 +49,32 @@
 
 function [K, Q, P, Ee, Er] = dlqg (A, B, C, G, Sigw, Sigv, Q, R)
 
-  warning("dlqg: obsolete. use lqg instead (system data structure format)");
+  warning ("dlqg: obsolete. use lqg instead (system data structure format)");
 
   if (nargin == 5)
     ## system data structure format
 
     ## check that it really is system data structure
-    if(! isstruct(A) )
-      error("dlqg: 5 arguments, first argument is not a system data structure structure")
+    if (! isstruct (A))
+      error ("dlqg: 5 arguments, first argument is not a system data structure structure")
     endif
 
-    sys = sysupdate(sys,"ss");    # make sure in proper form
-    [ncstates,ndstates,nin,nout] = sysdimensions(sys);
-    if(ndstates == -1)
-      error("this message should never appear: bad system dimensions");
+    sys = sysupdate (sys, "ss");    # make sure in proper form
+    [ncstates, ndstates, nin, nout] = sysdimensions (sys);
+    if (ndstates == -1)
+      error ("this message should never appear: bad system dimensions");
     endif
 
-    if(ncstates)
-      error("dlqg: system has continuous-time states (try lqg?)")
-    elseif(ndstates < 1)
-      error("dlqg: system has no discrete time states")
-    elseif(nin <= columns(Sigw))
-      error(["dlqg: ",num2str(nin)," inputs provided, noise dimension is ", ...
-          num2str(columns(Sigw))])
-    elseif(nout != columns(Sigv))
-      error(["dlqg: number of outputs (",num2str(nout),") incompatible with ", ...
-          "dimension of Sigv (",num2str(columns(Sigv)),")"])
+    if (ncstates)
+      error ("dlqg: system has continuous-time states (try lqg?)")
+    elseif (ndstates < 1)
+      error ("dlqg: system has no discrete time states")
+    elseif (nin <= columns (Sigw))
+      error ("dlqg: %d inputs provided, noise dimension is %d",
+	      nin, columns (Sigw));
+    elseif (nout != columns(Sigv))
+      error ("dlqg: number of outputs (%d) incompatible with dimension of Sigv (%d)",
+	     nout, columns (Sigv));
     endif
 
     ## put parameters into correct variables
@@ -82,8 +82,8 @@
     Q = G;
     Sigv = C;
     Sigw = B;
-    [A,B,C,D] = sys2ss(Sys)
-    [n,m] = size(B)
+    [A, B, C, D] = sys2ss (Sys)
+    [n, m] = size (B)
     m1 = columns(Sigw);
     m2 = m1+1;
     G = B(:,1:m1);
@@ -91,35 +91,35 @@
 
   elseif (nargin == 8)
     ## state-space format
-    m = columns(B);
-    m1 = columns(G);
-    p = rows(C);
-    n = abcddim(A,B,C,zeros(p,m));
-    n1 = abcddim(A,G,C,zeros(p,m1));
-    if( (n == -1) || (n1 == -1))
-      error("dlqg: A,B,C,G incompatibly dimensioned");
-    elseif(p != columns(Sigv))
-      error("dlqg: C, Sigv incompatibly dimensioned");
-    elseif(m1 != columns(Sigw))
-      error("dlqg: G, Sigw incompatibly dimensioned");
+    m = columns (B);
+    m1 = columns (G);
+    p = rows (C);
+    n = abcddim (A, B, C, zeros (p, m));
+    n1 = abcddim (A, G, C, zeros (p, m1));
+    if (n == -1 || n1 == -1)
+      error ("dlqg: A,B,C,G incompatibly dimensioned");
+    elseif (p != columns (Sigv))
+      error ("dlqg: C, Sigv incompatibly dimensioned");
+    elseif (m1 != columns (Sigw))
+      error ("dlqg: G, Sigw incompatibly dimensioned");
     endif
   else
     error ("dlqg: invalid number of arguments")
   endif
 
-  if (! (issquare(Sigw) && issquare(Sigv) ) )
-    error("dlqg: Sigw, Sigv must be square");
+  if (! (issquare (Sigw) && issquare (Sigv)))
+    error ("dlqg: Sigw, Sigv must be square");
   endif
 
   ## now we can just do the design; call dlqr and dlqe, since all matrices
   ## are not given in Cholesky factor form (as in h2syn case)
-  [Ks, P, Er] = dlqr(A,B,Q,R);
-  [Ke, Q, jnk, Ee] = dlqe(A,G,C,Sigw,Sigv);
+  [Ks, P, Er] = dlqr (A, B, Q, R);
+  [Ke, Q, jnk, Ee] = dlqe (A, G, C, Sigw, Sigv);
   Ac = A - Ke*C - B*Ks;
   Bc = Ke;
   Cc = -Ks;
-  Dc = zeros(rows(Cc),columns(Bc));
-  K = ss(Ac,Bc,Cc,Dc,1);
-  disp("HODEL: need to add names to this guy!")
+  Dc = zeros (rows(Cc), columns(Bc));
+  K = ss (Ac, Bc, Cc, Dc, 1);
+  disp ("HODEL: need to add names to this guy!")
 
 endfunction
--- a/scripts/control/obsolete/minfo.m
+++ b/scripts/control/obsolete/minfo.m
@@ -44,17 +44,17 @@
 
 function [systype, nout, nin, ncstates, ndstates] = minfo (inmat)
 
-  warning("minfo: obsolete.  Use sys2ss, sys2tf, or sys2zp.");
+  warning ("minfo: obsolete.  Use sys2ss, sys2tf, or sys2zp.");
 
-  if (nargin ~= 1 )
+  if (nargin != 1 )
     disp ("MINFO: Wrong number of arguments")
     systype = nout = nin = ncstates = ndstates = [];
   endif
 
-  [rr,cc] = size(inmat);
+  [rr, cc] = size (inmat);
 
   ## Check for empty matrix first!
-  if (isempty(inmat))
+  if (isempty (inmat))
     systype = "empty";
     nout = nin = ncstates = ndstates = 0;
     return
@@ -91,4 +91,5 @@
     ncstates = 0;
     ndstates = 0;
   endif
+
 endfunction
--- a/scripts/control/obsolete/packsys.m
+++ b/scripts/control/obsolete/packsys.m
@@ -38,17 +38,16 @@
   warning("packsys is obsolete!  Use ss instead.");
 
   if (nargin < 3 || nargin > 5)
-    disp("packsys: Invalid number of arguments")
+    disp ("packsys: Invalid number of arguments");
   endif
 
   ## check dflg
-  if(nargin == 5)
-    if( !isscalar(dflg))
-      [m,n] = size(dflg);
-      error(["packsys: dflg (",num2str(m),",",num2str(n), ...
-        ") must be a scalar."]);
-    elseif( (dflg != 0) && (dflg != 1))
-      error(["packsys: dflg=",num2str(dflg),"must be 0 or 1"]);
+  if (nargin == 5)
+    if (! isscalar (dflg))
+      [m, n] = size(dflg);
+      error (["packsys: dflg (%d,%d) must be a scalar", m, n);
+    elseif (dflg != 0 && dflg != 1)
+      error ("packsys: dflg=%g must be 0 or 1", dflg);
     endif
   else
     ## default condition
@@ -57,16 +56,16 @@
 
   if (nargin == 3)
     ## No D matrix.  Form a zero one!
-    [brows,bcols] = size(b);
-    [crows,ccols] = size(c);
-    d = zeros(crows,bcols);
+    [brows, bcols] = size (b);
+    [crows, ccols] = size (c);
+    d = zeros (crows, bcols);
   endif
 
-  [n,m,p] = abcddim(a,b,c,d);
+  [n, m, p] = abcddim (a, b, c, d);
   if (n == -1 || m == -1 || p == -1)
-    error("packsys: incompatible dimensions")
+    error ("packsys: incompatible dimensions")
   endif
 
-  Asys = ss(a,b,c,d,dflg);
+  Asys = ss (a, b, c, d, dflg);
 
 endfunction
--- a/scripts/control/obsolete/qzval.m
+++ b/scripts/control/obsolete/qzval.m
@@ -41,7 +41,7 @@
 
 function lam = qzval (A, B)
 
-  warning("qzval is obsolete; calling qz instead")
-  lam = qz(A,B);
+  warning ("qzval is obsolete; calling qz instead")
+  lam = qz (A, B);
 
 endfunction
--- a/scripts/control/obsolete/rotg.m
+++ b/scripts/control/obsolete/rotg.m
@@ -24,6 +24,6 @@
 
 function [c, s] = rotg (a, b)
 
-  [c,s] = givens(a,b);
+  [c, s] = givens (a, b);
 
 endfunction
--- a/scripts/control/obsolete/series.m
+++ b/scripts/control/obsolete/series.m
@@ -43,56 +43,56 @@
 
   ## If two arguments input, take care of mu system case
 
-  warning("series is superseded by sysmult; use sysmult instead.")
+  warning ("series is superseded by sysmult; use sysmult instead.")
 
   muflag = 0;
-  if(nargin == 2)
-    temp=b1;
-    [a1,b1,c1,d1]=sys2ss(a1);
-    [a2,b2,c2,d2]=sys2ss(temp);
+  if (nargin == 2)
+    temp = b1;
+    [a1, b1, c1, d1] = sys2ss (a1);
+    [a2, b2, c2, d2] = sys2ss (temp);
     muflag = 1;
   endif
 
   ## If four arguments input, put two transfer functions in series
 
-  if(nargin == 4)
-    a = conv(a1,c1);    % was conv1
-    b = conv(b1,d1);    % was conv1
+  if (nargin == 4)
+    a = conv (a1, c1);    # was conv1
+    b = conv (b1, d1);    # was conv1
     c = 0;
     d = 0;
 
     ## Find series combination of 2 state space systems
 
-  elseif((nargin == 8)||(muflag == 1))
+  elseif (nargin == 8 || muflag == 1)
 
     ## check matrix dimensions
 
-    [n1,m1,p1] = abcddim(a1,b1,c1,d1);
-    [n2,m2,p2] = abcddim(a2,b2,c2,d2);
+    [n1, m1, p1] = abcddim (a1, b1, c1, d1);
+    [n2, m2, p2] = abcddim (a2, b2, c2, d2);
 
-    if((n1 == -1) || (n2 == -1))
-      error("Incorrect matrix dimensions");
+    if (n1 == -1 || n2 == -1)
+      error ("incorrect matrix dimensions");
     endif
 
     ## check to make sure the number of outputs of system1 equals the number
     ## of inputs of system2
 
-   if(p1 ~= m2)
-     error("System 1 output / System 2 input connection sizes do not match");
+   if(p1 != m2)
+     error ("system 1 output / system 2 input connection sizes do not match");
    endif
 
    ## put the two state space systems in series
 
-    a = [a1, zeros(rows(a1),columns(a2));b2*c1, a2];
-    b = [b1;b2*d1];
+    a = [a1, zeros(rows(a1), columns(a2)); b2*c1, a2];
+    b = [b1; b2*d1];
     c = [d2*c1, c2];
     d = [d2*d1];
 
     ## take care of mu output
 
-    if(muflag == 1)
-      a=ss(a,b,c,d);
-      b=c=d=0;
+    if (muflag == 1)
+      a = ss (a, b, c, d);
+      b = c = d = 0;
     endif
   endif
 
--- a/scripts/control/obsolete/swapcols.m
+++ b/scripts/control/obsolete/swapcols.m
@@ -31,7 +31,7 @@
 
 function B = swapcols (A)
 
-  m = length(A(1,:));
+  m = length (A(1,:));
   idx = m:-1:1;
   B = A(:,idx);
 
--- a/scripts/control/obsolete/swaprows.m
+++ b/scripts/control/obsolete/swaprows.m
@@ -31,7 +31,7 @@
 
 function B = swaprows (A)
 
-  m = rows(A);
+  m = rows (A);
   idx = m:-1:1;
   B = A(idx,:);
 
--- a/scripts/control/obsolete/syschnames.m
+++ b/scripts/control/obsolete/syschnames.m
@@ -28,6 +28,6 @@
 
 function retsys = syschnames (sys, opt, list, names)
 
-  retsys = syssetsignals(sys,opt,names,list);
+  retsys = syssetsignals (sys, opt, names, list);
 
 endfunction
--- a/scripts/control/obsolete/unpacksys.m
+++ b/scripts/control/obsolete/unpacksys.m
@@ -25,8 +25,8 @@
 
 function [a, b, c, d] = unpacksys (syst)
 
-  warning("unpacksys obsolete; calling sys2ss");
-  [a,b,c,d] = sys2ss(syst);
+  warning ("unpacksys obsolete; calling sys2ss");
+  [a, b, c, d] = sys2ss (syst);
 
 endfunction