[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: strange error with octave 4.0 but not in matlab 2013b
From: |
Sebastian Schöps |
Subject: |
Re: strange error with octave 4.0 but not in matlab 2013b |
Date: |
Wed, 1 Jun 2016 13:02:25 -0700 (PDT) |
RT wrote
> The code that was suggested was.
>
> a = [1,2,30,4,5,60,7,8,90,999]
> b((1:numel(a)) + mod(1:numel(a), 3) - 1) = a;
>
> b is equal to 1 30 2 4 60 5 7 90 8 999
>
> but if I try it with octave 4.0 on ubuntu 16.04 64bit
> I get an error
> "error: Invalid resizing operation or ambiguous assignment to an
> out-of-bounds array element"
It works for me with Octave 4.0.2 on Mac OS X:
octave:1> a = [1,2,30,4,5,60,7,8,90,999];
octave:2> b((1:numel(a)) + mod(1:numel(a), 3) - 1) = a
b =
1 30 2 4 60 5 7 90 8 999
--
View this message in context:
http://octave.1599824.n4.nabble.com/strange-error-with-octave-4-0-but-not-in-matlab-2013b-tp4677365p4677366.html
Sent from the Octave - General mailing list archive at Nabble.com.