Mercurial > hg > octave-lyh
changeset 70:a5e8b7c9a3ad
[project @ 1993-08-30 14:32:55 by jwe]
author | jwe |
---|---|
date | Mon, 30 Aug 1993 14:32:55 +0000 |
parents | d2d19bd98f60 |
children | ca37b3c9d066 |
files | scripts/control/abcddim.m |
diffstat | 1 files changed, 19 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/control/abcddim.m +++ b/scripts/control/abcddim.m @@ -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