From bug-octave-request at bevo dot che dot wisc dot edu Mon Apr 30 07:34:27 2001 Subject: center([]) fails From: Paul Kienzle To: bug-octave at bevo dot che dot wisc dot edu Date: Mon, 30 Apr 2001 13:27:50 +0100 The following is a patch against 2.1.34 so that center([]) returns []. Paul Kienzle pkienzle at kienzle dot powernet dot co dot uk *** scripts/ChangeLog 2001/04/30 12:19:43 1.1 --- scripts/ChangeLog 2001/04/30 12:22:33 *************** *** 1,3 **** --- 1,7 ---- + 2001-04-30 Paul Kienzle + + * statistics/base/center.m: accept and return empty matrix + 2001-04-18 A. Scottedward Hodel * control/system/is_stabilizable.m: Pass a to sys2ss, not sys. *** scripts/statistics/base/center.m 2001/04/30 12:18:16 1.1 --- scripts/statistics/base/center.m 2001/04/30 12:19:25 *************** *** 33,38 **** --- 33,40 ---- retval = x - mean(x); elseif is_matrix (x) retval = x - ones (rows (x), 1) * mean(x); + elseif isempty(x) + retval = x; else error ("center: x must be a vector or a matrix"); endif ------------------------------------------------------------- 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 -------------------------------------------------------------