help-octave
[Top][All Lists]
Advanced

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

Re: Constructing arrays


From: Andy Buckle
Subject: Re: Constructing arrays
Date: Mon, 26 Jul 2010 14:44:57 +0100

On Mon, Jul 26, 2010 at 2:33 PM, dirac <address@hidden> wrote:
> Yes you did understand right! I understand how you do it now, and I do need
> to get rid of the zeros at the end. I was wondering how you would propose I
> do this? Would a for loop with an if statement be ok, or would that be slow
> to perform?
>
> I do really appreciate your help Martin, Thanks again

I haven't followed this whole thread. However removing zeros is quick

>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

Andy

PS please remember to post _after_ previous text when including in replies.


reply via email to

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