|
From: | Nicholas Jankowski |
Subject: | Re: how to get the element >0 in array |
Date: | Wed, 18 Jul 2018 09:38:46 -0400 |
> -----Original Message-----
> From: Help-octave [mailto:help-octave-
> bounces+allen.windhorn=mail.address@hidden ] On Behalf Of turbofib
>
> i've the following array:
>
> a=[-3 -5 0 5 4]
>
> i want to loop it until i find element>0 (5)
>
> can I loop it but is there a faster method?
>> a=[-3 -5 0 5 4]
a = -3 -5 0 5 4
>> a(a>0)
ans =
5 4
>> a(a>0)(1)
ans = 5
Regards,
Allen
[Prev in Thread] | Current Thread | [Next in Thread] |