home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
octa21eb.zip
/
octave
/
SCRIPTS.ZIP
/
scripts.fat
/
control
/
minfo.m
< prev
next >
Wrap
Text File
|
1999-04-29
|
3KB
|
85 lines
# Copyright (C) 1996 A. Scottedward Hodel
#
# This file is part of Octave.
#
# Octave is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (at your option) any
# later version.
#
# Octave is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with Octave; see the file COPYING. If not, write to the Free
# Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
function [systype, nout, nin, ncstates, ndstates] = minfo(inmat)
# function [systype, nout, nin, ncstates, ndstates] = minfo(inmat)
#
# MINFO: Determines the type of system matrix. INMAT can be
# a varying(*), system, constant, and empty matrix.
#
# Returns:
# systype can be one of:
# varying, system, constant, and empty
# nout is the number of outputs of the system
# nin is the number of inputs of the system
# ncstates is the number of continuous states of the system
# ndstates is the number of discrete states of the system
# Written by R. Bruce Tenison July 29, 1994
# Modified by David Clem November 13, 1994
# Modified by A. S. Hodel July 1995
warning("minfo: obsolete. Use sys2ss, sys2tf, or sys2zp.");
if (nargin ~= 1 )
disp('MINFO: Wrong number of arguments')
systype = nout = nin = ncstates = ndstates = [];
endif
[rr,cc] = size(inmat);
# Check for empty matrix first!
if (isempty(inmat))
systype = "empty";
nout = nin = ncstates = ndstates = 0;
return
# Check for Constant matrix
elseif (rr == 1 || cc == 1)
systype = "constant";
nout = nin = ncstates = ndstates = 1;
return
# Check for system type matrix
elseif (inmat(rr,cc) == -Inf)
systype = "system";
ncstates = inmat(1,cc);
ndstates = inmat(rr,1);
nstates = ncstates + ndstates;
nout = rr - nstates - 1;
nin = cc - nstates - 1;
# Check for Varying type matrix
elseif (inmat(rr,cc) == Inf)
systype = "varying";
npoints = inmat(rr,cc-1);
nin = cc - 1;
nout = rr / npoints;
nstates = 0;
# Must be a standard matrix
else
systype = "constant";
nin = cc;
nout = rr;
ncstates = 0;
ndstates = 0;
endif
endfunction