help-octave
[Top][All Lists]
Advanced

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

Re: prefer_zero_one_indexing dissapeared from 2.0 to 2.1: how can I live


From: Bill Denney
Subject: Re: prefer_zero_one_indexing dissapeared from 2.0 to 2.1: how can I livewithout it?
Date: Fri, 06 Oct 2006 17:06:41 -0400
User-agent: Thunderbird 1.5.0.7 (Windows/20060909)

Etienne Grossmann wrote:
octave:33> a = [1, 2, 3, 4]
a =

   1   2   3   4

octave:34> a([0,1,1,1])
error: invalid vector index = 0
octave:34> a(!![0,1,1,1])
ans =

   2   3   4
This shows a bit more directly what he is doing:
octave:3> a = 1:4
a =
 1  2  3  4
octave:4> a(logical([0 1 1 1]))
ans =
  2   3   4
octave:5> version
ans = 2.9.9

Bill



reply via email to

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