From bug-octave-request at bevo dot che dot wisc dot edu Mon Dec 15 05:49:30 2003 Subject: zp2sys and bode From: Gabriele Pannocchia To: "Giovanni Visciano" Cc: bug-octave at bevo dot che dot wisc dot edu Date: Mon, 15 Dec 2003 12:52:19 +0100 Hi, I think the error is generated by line 74 of zp2ss.m. Here is my fix proposal. --- /usr/share/octave/2.1.50/m/control/system/zp2ss.m Mon Sep 22 18:06:43 2003 +++ zp2ss.m Mon Dec 15 12:43:49 2003 at @ -71,7 +71,7 @@ warning("zp2ss: k is complex") endif - zpsys = ss2sys([],[],[],k); + zpsys = ss2sys(zeros(0,0),zeros(0,1),zeros(1,0),k); ## Find the number of zeros and the number of poles nzer=length(zer); The reason for this fix is that a pure gain system (as it is meant to be defined in line 74) should have 0 states but still 1 input and 1 output. Hence its state-space matrices should be: A = zeros(0,0); B = zeros(0,1); C = zeros(1,0); D = k; Cheers, Gabriele > > bode (zp2sys ([],[0],1)) > error: number of columns must match (2 != 1) > error: evaluating assignment expression near line 97, column 7 > error: evaluating if command near line 71, column 3 > error: called from `sysgroup' in file `/home/gio/Octave-2.1.50/share/octave/2.1.50/m/control/system/sysgroup.m' > error: evaluating assignment expression near line 96, column 9 > error: evaluating if command near line 65, column 3 > error: called from `sysmult' in file `/home/gio/Octave-2.1.50/share/octave/2.1.50/m/control/system/sysmult.m' > error: evaluating assignment expression near line 146, column 11 > error: evaluating while command near line 95, column 3 > error: called from `zp2ss' in file `/home/gio/Octave-2.1.50/share/octave/2.1.50/m/control/system/zp2ss.m' > error: evaluating if command near line 109, column 5 > error: evaluating if command near line 107, column 3 > error: called from `sysupdate' in file `/home/gio/Octave-2.1.50/share/octave/2.1.50/m/control/system/sysupdate.m' > error: evaluating assignment expression near line 153, column 9 > error: evaluating if command near line 152, column 3 > error: called from `sysgetsignals' in file `/home/gio/Octave-2.1.50/share/octave/2.1.50/m/control/system/sysgetsignals.m' > error: called from `bode' in file `/home/gio/Octave-2.1.50/share/octave/2.1.50/m/control/base/bode.m' ------------------------------------------------------------- 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 -------------------------------------------------------------