help-octave
[Top][All Lists]
Advanced

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

Re: Constructing arrays


From: John W. Eaton
Subject: Re: Constructing arrays
Date: Tue, 27 Jul 2010 11:36:55 -0400

On 26-Jul-2010, Andy Buckle wrote:

| >a=floor(rand(1,16)*3)
| a =
| 
|    1   0   1   0   1   0   1   2   0   2   1   0   0   0   0   2
| 
| >a(find(a==0))=[]
| a =
| 
|    1   1   1   1   2   2   1   2

The call to find is not necessary here.  You can use

  a(a == 0) = []

to do the same thing.

jwe


reply via email to

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