|
From: | Rick T |
Subject: | Re: deleting columns in array with zeros |
Date: | Wed, 21 Mar 2012 12:08:22 -1000 |
x = [0 0 0 0 0 2 4 6 8 0 1 2];
On Mar 21, 2012, at 5:12 PM, Rick T wrote:
> Greetings
>
> I have an array that starts of with zeros and continues into other numbers
> I would like to delete the columns in the array that start off with zero but keep the other numbers
>
> example of a column array below:
>
> 0 0 0 0 0 2 4 6 8 0 1 2
>
> Answer of column array would like like
>
> 2 4 6 8 0 1 2
>
> I'm using octave 3.4.2
> Thanks
n = find (x > 0, 1);
x = x(n:end);
Ben
[Prev in Thread] | Current Thread | [Next in Thread] |