From octave-sources-request at bevo dot che dot wisc dot edu Sun Sep 5 12:26:20 1999 Subject: reshape patchlet From: etienne grossmann To: octave-sources at bevo dot che dot wisc dot edu CC: etienne at isr dot ist dot utl dot pt Date: Sun, 5 Sep 1999 18:25:50 +0100 (WEST) Hello, a little patch that allows doing x = reshape(y,size(z)) Etienne ps : I have done it on the 2.1.14 source tree. ====================================================================== --- scripts/general/reshape.m.orig Sun Sep 5 18:21:00 1999 +++ scripts/general/reshape.m Sun Sep 5 18:19:52 1999 at @ -28,8 +28,12 @@ function retval = reshape (a, m, n) - if (nargin != 3) - usage ("reshape (a, m, n)"); + if (nargin == 2 && prod(size(m)) == 2) + n = m(2) ; + m = m(1) ; + end + if (exist('n') != 1 ) + usage ("reshape (a, m, n) or reshape(a,size(b))"); else [nr, nc] = size (a); if (nr * nc == m * n) ======================================================================