julia> a = [i for i=filter(x->x<3,z)]
2-element Array{Any,1}:
 1
 2


On Wednesday, March 18, 2015 at 8:31:57 PM UTC+9, [email protected] wrote:
>
> Hi
> I want to fill an array based on a condition - eg
>
> a = []
> z = [1,2,3,4]
>
> for i = 1:length(z)
> if i > 2               
> continue
> end
> end
>
> so, I would now like to see the values 1 & 2 in  my array "a"
> Regards
>
>
>
>
>

Reply via email to