From octave-sources-request at bevo dot che dot wisc dot edu Fri Oct 22 09:18:40 1999 Subject: patchlet for reshape.m 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: Fri, 22 Oct 1999 15:17:38 +0100 (WEST) Hello, this patch is for that : size(reshape(zeros(0,20),40,0)) returns [40,0], instead of the current [0,0]. This helps (my code, at least) handle more easily matrices with one zero dimension. It sounds reasonable to expect from reshape(A,H,W) to return a H-by-W matrix, as long as prod(size(A))==H*W. Doesn't it? ====================================================================== --- scripts/general/reshape.m.102299 Fri Oct 22 15:02:15 1999 +++ scripts/general/reshape.m Fri Oct 22 15:02:36 1999 at @ -43,7 +43,7 @@ do_fortran_indexing = 1; implicit_str_to_num_ok = 1; retval = zeros (m, n); - retval (:) = a; + retval (:) = a(:); if (isstr (a)) retval = setstr (retval); endif ====================================================================== Greetings, Etienne