From bug-octave-request Mon Jun 21 14:58:22 1993 Subject: assignment to null matrices From: hodelas at CONTROLS dot msfc dot nasa dot gov (A. Scott Hodel) To: bug-octave Date: Mon, 21 Jun 93 15:07:32 CDT On a DELL '386 running Unix: When assigning a vector as a specified column of an undefined matrix, some odd behavior occurs: ----------------------------------------------------------------- /home/hodelas/mfiles/hodel $ octave Octave, version 0.72. Copyright (C) 1992, 1993, John W. Eaton. This is free software with ABSOLUTELY NO WARRANTY. For details, type `warranty'. octave:1> who % no variables defined octave:2> hv = ones(10,1); % set hv = column vector octave:3> U % U is undefined error: `U' undefined octave:4> U(:,1) = hv % assign a column of U error: invalid assignment to scalar octave:4> U % U is a scalar now! How? U = 0 ------------------------------------------------------------------ The desired behavior (to be MATLAB compatible) is to allow the statement in line 4 to be executed if U is undefined; i.e., U column 1 is set to hv. (Admittedly, line 4 is kludgy.)