help-octave
[Top][All Lists]
Advanced

[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: Doug Stewart
Subject: Re: strange error with octave 4.0 but not in matlab 2013b
Date: Wed, 1 Jun 2016 16:44:31 -0400



On Wed, Jun 1, 2016 at 4:27 PM, RT <address@hidden> wrote:
I was trying to circshift using index values.  The original question I had was posted at
http://stackoverflow.com/questions/37575728/circshift-using-index-values/37575834?noredirect=1#comment62641575_37575834

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"

_______________________________________________
Help-octave mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-octave


It works for me on octave 4.1.0+ and ubuntu 15.10

 a = [1,2,30,4,5,60,7,8,90,999];
>>  b((1:numel(a)) + mod(1:numel(a), 3) - 1) = a
b =

     1    30     2     4    60     5     7    90     8   999
--
DAS


reply via email to

[Prev in Thread] Current Thread [Next in Thread]