help-octave
[Top][All Lists]

## Re: letting find search for zeros

 From: Douglas Eck Subject: Re: letting find search for zeros Date: Mon, 05 Nov 2001 13:46:46 +0100 User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20010913

```Ah one that I can answer:

octave:6> val
val =

1        3        0        1        0

octave:7> find(val==0)
ans =

3        5

Cheers,
Doug

Hendrik Naumann wrote:

```
```-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

```
Does anybody know a function that returns the indices of the zero elements of an vector?
```
The solution I found is

octave-2.1.34:13> val = [1,3,0,1,0];
octave-2.1.34:14> find(isnan( val / 0))
...
ans =
```
3 5
```
That gives an ugly warning, so I am looking for an better solution.

Hendrik Naumann
```
- -- PGP ID 21F0AC0265C92061
```-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE75mOrIfCsAmXJIGERAmB8AJ9xVLizKhZuhLqEKzaFuQNqGZ/K2ACeOeKI
xB1rWXL0Xiz97xOyOg90dhk=
=0vMI
-----END PGP SIGNATURE-----

-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

```
```

--
Dr. Douglas Eck, http://www.idsia.ch/~doug
Istituto Dalle Molle di Studi sull'Intelligenza Artificiale (IDSIA)
Neural Networks, Rhythm Perception and Production, Dynamical Systems

-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

```