From bug-octave-request at che dot utexas dot edu Wed May 18 15:14:46 1994 Subject: Problem with matrix assignment From: "G.Beyerle" To: bug-octave at che dot utexas dot edu Cc: gbeyerle at AWI-Potsdam dot DE Date: Wed, 18 May 94 22:14:30 GMT Hello *, I found the following problem: ---------------------------------------- octave:1> x=ones(2:2) x = 1 1 1 1 octave:2> x(:,[1:2])=x error: A(:,matrix) = X: the number of rows in X must match the error: number of rows in A, and the number of columns in X must error: match the number of elements in matrix error: evaluating assignment expression near line 2, column 11 ----------------------------------------- The problem can be fixed with the following change: *** tc-assign.cc Wed May 18 21:43:06 1994 --- tc-assign.cc.orig Wed May 18 22:02:21 1994 *************** *** 1251,1257 **** if (nr == 0) new_nr = rhs_nr; ! if ( indexed_assign_conforms (new_nr, jv.capacity (), rhs_nr, rhs_nc)) { maybe_resize (new_nr-1, jv.max ()); --- 1251,1257 ---- if (nr == 0) new_nr = rhs_nr; ! if (! indexed_assign_conforms (new_nr, jv.capacity (), rhs_nr, rhs_nc)) { maybe_resize (new_nr-1, jv.max ()); ----------------------------------------- Octave version : 1.0 System : SunOS 4.1.3_U1 ----------------------------------------- Thanks Georg | Georg Beyerle | | Alfred Wegener Institute of Tel: +49-331-288-2119 | | Polar and Marine Research Fax: +49-331-288-2137 | | POB 600 149 E-Mail: gbeyerle at awi-potsdam dot de| | | D-14401 Potsdam Germany |