[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: |
Etienne Grossmann |
Subject: |
Re: prefer_zero_one_indexing dissapeared from 2.0 to 2.1: how can I livewithout it? |
Date: |
Fri, 6 Oct 2006 16:04:16 -0400 |
User-agent: |
Mutt/1.4.2.1i |
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
octave:35> version
ans = 2.9.8
This also works.
Hth,
Etienne
On Fri, Oct 06, 2006 at 01:49:33PM +0200, Miquel Cabanas wrote:
# On Fri, 2006-10-06 at 12:06 +0200, TEJEDA HERNANDEZ, CESAR wrote:
# >
# > I have a program that uses that feature, and it seems for me that this
# > feature of doing a Boolean indexing:
# >
# > a = [1, 2, 3, 4]
# >
# > a ([0, 1, 1, 1])
# >
# > results in the matrix `[ 2, 3, 4 ]'.
# >
#
# try,
#
# a = [1 2 3 4];
# b = [0 1 1 1];
#
# then either of
#
# find (a.*b > 0)
#
# or
#
# a (find (b == 1))
#
# or
#
# a (find (b))
#
# will return
#
# [2 3 4]
#
#
#
# Miquel
#
#
#
#
# _______________________________________________
# Help-octave mailing list
# address@hidden
# https://www.cae.wisc.edu/mailman/listinfo/help-octave
--
Etienne Grossmann ------ http://www.isr.ist.utl.pt/~etienne