Subscripted assignment issue

David Bateman adb014 at gmail.com
Sun Mar 23 15:46:41 CDT 2008


John W. Eaton wrote:
> On 23-Mar-2008, dbateman wrote:
> 
> | 
> | 
> | 
> | Moritz Borgmann wrote:
> | > 
> | > 
> | > When the left-hand side of a matrix assignment is subscripted, MATLAB 
> | > extends the matrix to fit the right-hand side. Octave does not, but 
> | > instead fails with an error message.
> | > 
> | > 
> | 
> | Fixed already. See the message
> | 
> | http://www.nabble.com/Array-indexing-issue-is-original-matrix-empty-to16156127.html
> 
> I think this still fails:
> 
>   octave:1> a = [];
>   octave:2> a(1,:,:) = ones (2,2)
>   error: A(IDX-LIST) = X: X must be a scalar or size of X must equal number of elements indexed by IDX-LIST
> 
> jwe


Humm, then my patch didn't do the right thing here as I let the
assignment suceed only if the dim on the LHS wasn't a colon. Should we
just let everything thing through at the current test and trap
dimensioning error later? I'm not sure of the best and compatible way to
treat this..

D..




More information about the Bug-octave mailing list