Mercurial > hg > octave-nkf
diff scripts/control/system/sysgetsignals.m @ 3462:04aef7306dca
[project @ 2000-01-19 17:16:43 by hodelas]
Updated to accept signal names or signal indices as inputs (calls to
either sysidx or listidx)
author | hodelas |
---|---|
date | Wed, 19 Jan 2000 17:16:45 +0000 |
parents | 3234a698073a |
children | 7923abdeb4e5 |
line wrap: on
line diff
--- a/scripts/control/system/sysgetsignals.m +++ b/scripts/control/system/sysgetsignals.m @@ -41,16 +41,17 @@ ## @end table ## ## @item signum -## Index of signal (or indices of signals if signum is a vector) +## index(indices) or name(s) or signals; see @code{sysidx} ## ## @item strflg ## flag to return a string instead of a list; Values: ## @table @code ## @item 0 -## (default) return a list (even if signum is a scalar) +## (default) return a list (even if signum specifies an individual signal) ## ## @item 1 -## return a string. Exits with an error if signum is not a scalar. +## return a string. Exits with an error if signum does not specify an +## individual signal. ## @end table ## ## @end table @@ -166,7 +167,10 @@ sigid)); endif if(nargin >= 3) - if(signum > length(stname)) + if( is_signal_list(signum) | isstr(signum) ) + signum = listidx(stname,signum); + end + if(max(signum) > length(stname)) error(sprintf("sysgetsignals(sys,\"%s\",%d):only %d entries.\n", ... sigid,signum, rows(stname))); else