From bug-octave-request at bevo dot che dot wisc dot edu Thu Mar 25 15:12:11 2004 Subject: Re: ss2sys not being updated? From: David Bateman To: Geraint Paul Bevan Cc: "Joseph C. Slater" , help-octave@bevo.che.wisc.edu, bug-octave@bevo.che.wisc.edu Date: Thu, 25 Mar 2004 22:08:00 +0100 --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I'm using 2.1.57, and it works for me. In any case, on second thoughts, the documentation for bode, ss, ss2sys, sysprune, etc are wrong as they use list() in their examples. Furthermore, it seems that listidx.m is depreciated to the point of not being usuable, therefore sysidx doesn't work as it still refers to listidx. Therefore, things like bode() don't work!!!! So you're use of the example in the documentation in fact points out the buglet in the docs. The attached patch below tries to addresses the documentation errors, and the things I noticed broken here. Perhaps there are also other problems D. According to Geraint Paul Bevan (on 03/25/04): > Joseph C. Slater wrote on 03/25/04 18:39: > > > >On Mar 25, 2004, at 11:53 AM, David Bateman wrote: > > > >>Try "sys = ss2sys(a,b,c,[],0,3,0,{"volts","amps","joules"});" instead. > >> > >>D. > >> > > > > >I got the sam exact error (to the letter). > >Joe > > > > What version of Octave are you using? It works with 2.1.55 and 2.1.57. > > -- > Geraint Bevan > http://www.mech.gla.ac.uk/~gbevan -- David Bateman David dot Bateman at motorola dot com Motorola CRM +33 1 69 35 48 04 (Ph) Parc Les Algorithmes, Commune de St Aubin +33 1 69 35 77 01 (Fax) 91193 Gif-Sur-Yvette FRANCE The information contained in this communication has been classified as: [x] General Business Information [ ] Motorola Internal Use Only [ ] Motorola Confidential Proprietary --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=patch *** ./scripts/control/base/bode.m.orig 2004-02-16 20:57:22.000000000 +0100 --- ./scripts/control/base/bode.m 2004-03-25 21:44:58.000000000 +0100 *************** *** 67,73 **** ## ## at strong{Example} ## at example ! ## bode(sys,[],"y_3",list("u_1","u_4"); ## at end example ## at end table ## at strong{Outputs} --- 67,73 ---- ## ## at strong{Example} ## at example ! ## bode(sys,[],"y_3", at {"u_1","u_4"@}); ## at end example ## at end table ## at strong{Outputs} *** ./scripts/control/base/lqg.m.orig 2004-02-16 20:57:22.000000000 +0100 --- ./scripts/control/base/lqg.m 2004-03-25 18:43:57.000000000 +0100 *************** *** 40,46 **** ## at itemx r ## state, control weighting respectively. Control ARE is ## at item in_idx ! ## names or indices of controlled inputs (see at code{sysidx}, @code{listidx}) ## ## default: last dim(R) inputs are assumed to be controlled inputs, all ## others are assumed to be noise inputs. --- 40,46 ---- ## at itemx r ## state, control weighting respectively. Control ARE is ## at item in_idx ! ## names or indices of controlled inputs (see at code{sysidx}, @code{cellidx}) ## ## default: last dim(R) inputs are assumed to be controlled inputs, all ## others are assumed to be noise inputs. *** ./scripts/control/system/ss2sys.m.orig 2004-02-16 20:57:22.000000000 +0100 --- ./scripts/control/system/ss2sys.m 2004-03-25 21:46:25.000000000 +0100 *************** *** 46,63 **** ## see below for system partitioning ## ## at item stname ! ## list of strings of state signal names ## ## default ( at var{stname}=[] on input): @code{x_n} for continuous states, ## at code{xd_n} for discrete states ## ## at item inname ! ## list of strings of input signal names ## ## default ( at var{inname} = [] on input): @code{u_n} ## ## at item outname ! ## list of strings of input signal names ## ## default ( at var{outname} = [] on input): @code{y_n} ## --- 46,63 ---- ## see below for system partitioning ## ## at item stname ! ## cell array of strings of state signal names ## ## default ( at var{stname}=[] on input): @code{x_n} for continuous states, ## at code{xd_n} for discrete states ## ## at item inname ! ## cell array of strings of input signal names ## ## default ( at var{inname} = [] on input): @code{u_n} ## ## at item outname ! ## cell array of strings of input signal names ## ## default ( at var{outname} = [] on input): @code{y_n} ## *************** *** 140,146 **** ## octave:1> a = [1 2 3; 4 5 6; 7 8 10]; ## octave:2> b = [0 0 ; 0 1 ; 1 0]; ## octave:3> c = eye(3); ! ## octave:4> sys = ss(a,b,c,[],0,3,0,list("volts","amps","joules")); ## octave:5> sysout(sys); ## Input(s) ## 1: u_1 --- 140,146 ---- ## octave:1> a = [1 2 3; 4 5 6; 7 8 10]; ## octave:2> b = [0 0 ; 0 1 ; 1 0]; ## octave:3> c = eye(3); ! ## octave:4> sys = ss(a,b,c,[],0,3,0, at {"volts","amps","joules"@}); ## octave:5> sysout(sys); ## Input(s) ## 1: u_1 *** ./scripts/control/system/cellidx.m.orig 2004-02-17 03:34:33.000000000 +0100 --- ./scripts/control/system/cellidx.m 2004-03-25 18:43:01.000000000 +0100 *************** *** 17,23 **** ## Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. ## -*- texinfo -*- ! ## at deftypefn {Function File} {[@var{idxvec}, @var{errmsg}] =} listidx (@var{listvar}, @var{strlist}) ## Return indices of string entries in at var{listvar} that match strings ## in at var{strlist} dot ## --- 17,23 ---- ## Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. ## -*- texinfo -*- ! ## at deftypefn {Function File} {[@var{idxvec}, @var{errmsg}] =} cellidx (@var{listvar}, @var{strlist}) ## Return indices of string entries in at var{listvar} that match strings ## in at var{strlist} dot ## *************** *** 29,35 **** ## ## If at var{strlist} contains a string not in @var{listvar}, then ## an error message is returned in at var{errmsg} dot If only one output ! ## argument is requested, then at var{listidx} prints @var{errmsg} to the ## screen and exits with an error. ## at end deftypefn --- 29,35 ---- ## ## If at var{strlist} contains a string not in @var{listvar}, then ## an error message is returned in at var{errmsg} dot If only one output ! ## argument is requested, then at var{cellidx} prints @var{errmsg} to the ## screen and exits with an error. ## at end deftypefn *** ./scripts/control/system/dmr2d.m.orig 2004-02-16 20:57:22.000000000 +0100 --- ./scripts/control/system/dmr2d.m 2004-03-25 18:43:20.000000000 +0100 *************** *** 29,35 **** ## at code{dmr2d} exits with an error if @var{sys} is not discrete ## at item idx ## indices or names of states with sampling time ! ## at code{sysgettsam(@var{sys})} (may be empty); see @code{listidx} ## at item sprefix ## list of string prefixes of states with sampling time ## at code{sysgettsam(@var{sys})} (may be empty) --- 29,35 ---- ## at code{dmr2d} exits with an error if @var{sys} is not discrete ## at item idx ## indices or names of states with sampling time ! ## at code{sysgettsam(@var{sys})} (may be empty); see @code{cellidx} ## at item sprefix ## list of string prefixes of states with sampling time ## at code{sysgettsam(@var{sys})} (may be empty) *** ./scripts/control/system/ss.m.orig 2004-02-17 03:34:33.000000000 +0100 --- ./scripts/control/system/ss.m 2004-03-25 21:46:39.000000000 +0100 *************** *** 46,63 **** ## see below for system partitioning ## ## at item stname ! ## list of strings of state signal names ## ## default ( at var{stname}=[] on input): @code{x_n} for continuous states, ## at code{xd_n} for discrete states ## ## at item inname ! ## list of strings of input signal names ## ## default ( at var{inname} = [] on input): @code{u_n} ## ## at item outname ! ## list of strings of input signal names ## ## default ( at var{outname} = [] on input): @code{y_n} ## --- 46,63 ---- ## see below for system partitioning ## ## at item stname ! ## cell array of strings of state signal names ## ## default ( at var{stname}=[] on input): @code{x_n} for continuous states, ## at code{xd_n} for discrete states ## ## at item inname ! ## cell array of strings of input signal names ## ## default ( at var{inname} = [] on input): @code{u_n} ## ## at item outname ! ## cell array of strings of input signal names ## ## default ( at var{outname} = [] on input): @code{y_n} ## *************** *** 140,146 **** ## octave:1> a = [1 2 3; 4 5 6; 7 8 10]; ## octave:2> b = [0 0 ; 0 1 ; 1 0]; ## octave:3> c = eye(3); ! ## octave:4> sys = ss(a,b,c,[],0,3,0,list("volts","amps","joules")); ## octave:5> sysout(sys); ## Input(s) ## 1: u_1 --- 140,146 ---- ## octave:1> a = [1 2 3; 4 5 6; 7 8 10]; ## octave:2> b = [0 0 ; 0 1 ; 1 0]; ## octave:3> c = eye(3); ! ## octave:4> sys = ss(a,b,c,[],0,3,0, at {"volts","amps","joules"@}); ## octave:5> sysout(sys); ## Input(s) ## 1: u_1 *** ./scripts/control/system/sysidx.m.orig 2002-08-09 20:58:14.000000000 +0200 --- ./scripts/control/system/sysidx.m 2004-03-25 18:44:41.000000000 +0100 *************** *** 38,50 **** endif ## extract correct set of signal names values ! [idxvec, msg] = listidx (list ("in", "out", "st", "yd"), sigtype); if (msg) error ("invalid sigtype = %s", sigtype); endif syssiglist = sysgetsignals (sys, sigtype); ! [idxvec, msg] = listidx (syssiglist, signamelist); if (length (msg)) error ("sysidx (sigtype = %s): %s", sigtype, strrep (msg, "strlist", "signamelist")); --- 38,50 ---- endif ## extract correct set of signal names values ! [idxvec, msg] = cellidx ({"in", "out", "st", "yd"}, sigtype); if (msg) error ("invalid sigtype = %s", sigtype); endif syssiglist = sysgetsignals (sys, sigtype); ! [idxvec, msg] = cellidx (syssiglist, signamelist); if (length (msg)) error ("sysidx (sigtype = %s): %s", sigtype, strrep (msg, "strlist", "signamelist")); *** ./scripts/control/system/sysprune.m.orig 2004-02-16 20:57:22.000000000 +0100 --- ./scripts/control/system/sysprune.m 2004-03-25 21:58:22.000000000 +0100 *************** *** 33,39 **** ## ## at example ## retsys = sysprune(Asys,[1:3,4],"u_1"); ! ## retsys = sysprune(Asys,list("tx","ty","tz"), 4); ## at end example ## ## at end table --- 33,39 ---- ## ## at example ## retsys = sysprune(Asys,[1:3,4],"u_1"); ! ## retsys = sysprune(Asys, at {"tx","ty","tz"@}, 4); ## at end example ## ## at end table *** ./scripts/ChangeLog.orig 2004-03-12 20:26:56.000000000 +0100 --- ./scripts/ChangeLog 2004-03-25 22:01:06.000000000 +0100 *************** *** 1,3 **** --- 1,10 ---- + 2004-03-25 David Bateman + * control/base/bode.m, control/base/lqg.m, control/system/ss2sys.m, + control/system/cellidx.m, control/system/dmr2d.m control/system/ss.m, + control/system/sysprune.m: Doc update for usage of cell arrays. + + * control/system/sysidx.m: Use cellidx and not listidx. + 2004-03-12 Stefan van der Walt * image/imshow.m: Accept "truesize" argument. --7AUc2qLy4jB3hD7Z-- ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------