# HG changeset patch # User jwe # Date 746721175 0 # Node ID a5e8b7c9a3adfcf480c7cac994bf4d08575f741c # Parent d2d19bd98f60a3bf7e0fd565cb97bbbb36d4c412 [project @ 1993-08-30 14:32:55 by jwe] diff -r d2d19bd98f60 -r a5e8b7c9a3ad scripts/control/abcddim.m --- a/scripts/control/abcddim.m Fri Aug 27 07:25:32 1993 +0000 +++ b/scripts/control/abcddim.m Mon Aug 30 14:32:55 1993 +0000 @@ -1,50 +1,50 @@ -function [n, m, p] = abcdchk (a, b, c, d) +function [n, m, p] = abcddim (a, b, c, d) -# Usage: [n, m, p] = abcdchk (a, b, c, d) +# Usage: [n, m, p] = abcddim (a, b, c, d) # # Check for compatibility of the dimensions of the matrices defining # the linear system (a, b, c, d). # -# returns n = number of system states, -# m = number of system inputs -# p = number of system outputs +# Returns n = number of system states, +# m = number of system inputs, +# p = number of system outputs. # -# returns n = m = p = -1 if system is not compatible +# Returns n = m = p = -1 if the system is not compatible. + +# Written by A. S. Hodel (scotte@eng.auburn.edu) August 1993 if (nargin != 4) - error ("abcdchk: illegal number of arguments. Need four.") + error ("abcddim: illegal number of arguments. need four.") endif - n = -1; - m = -1; - p = -1; + n = m = p = -1; - [an, am] = size (a); + [an, am] = size(a); if (an != am) - disp ("abcdchk: a is not square"); + fprintf (stderr, "abcddim: a is not square"); return; endif - [bn, bm] = size (b); + [bn, bm] = size(b); if (bn != am) - disp ("abcdchk: a, b are not compatible"); + fprintf (stderr, "abcddim: a and b are not compatible"); return; endif - [cn, cm] = size (c); + [cn, cm] = size(c); if (cm != an) - disp ("abcdchk: a, c are not compatible"); + fprintf (stderr, "abcddim: a and c are not compatible"); return; endif - [dn, dm] = size (d); + [dn, dm] = size(d); if (cn != dn) - disp ("abcdchk: c, d are not compatible"); + fprintf (stderr, "abcddim: c and d are not compatible"); return; endif if (bm != dm) - disp ("abcdchk: b, d are not compatible"); + fprintf (stderr, "abcddim: b and d are not compatible"); return; endif