help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Non-integer indices in ranges


From: Martin, Cary
Subject: Non-integer indices in ranges
Date: Tue, 2 Nov 2010 09:33:41 -0700

Hello World - This issue is probably well known to the users of this
list but if I execute this code in Octave:
 
x = 0:1:10;
x(1.5:5);
 
This is received:
error: subscript indices must be either positive integers or logicals.
 
In Matlab I get:
ans =
     1     2     3     4
 
To a certain extent the Matlab response is of course ridiculous but is
there any simple way to get this behavior in Octave or otherwise work
around this issue? I've got some external legacy code which  seems to
expects this behavior which I'd like to use without extensive rewriting.
 
thanks-
Cary



reply via email to

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