[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.
- Constructing arrays, dirac, 2010/07/26
- Re: Constructing arrays, Martin Helm, 2010/07/26
- Re: Constructing arrays, dirac, 2010/07/26
- Re: Constructing arrays, Martin Helm, 2010/07/26
- RE: Constructing arrays, dirac, 2010/07/26
- Re: Constructing arrays,
Andy Buckle <=
- Re: Constructing arrays, dirac, 2010/07/26
- Re: Constructing arrays, Andy Buckle, 2010/07/26
- Re: Constructing arrays, Martin Helm, 2010/07/26
- Re: Constructing arrays, dirac, 2010/07/27
- Re: Constructing arrays, John W. Eaton, 2010/07/27
- Re: Constructing arrays, dirac, 2010/07/28
- Re: Constructing arrays, Jaroslav Hajek, 2010/07/28