I recently ran into this issue. For future reference, this functionality
seems to have been renamed to splice!
julia> x = [1,2,3]
3-element Array{Int64,1}:
1
2
3
julia> splice!(x,2)
2
julia> x
2-element Array{Int64,1}:
1
3
I use the idiom A(I,:) = []; A(:,J) = []; a lot in Matlab to keep a large
block of A when I know I won't need rows I and columns J anymore. The
closest I can come to replicating this in Julia at the moment is A = A[!I,
!J], but this isn't ideal since (I assume) it involves allocating
additional memory for A[!I,!J] as an intermediate step.
On Thursday, November 29, 2012 10:23:28 AM UTC-5, Umberto wrote:
>
> Hi all
>
> how do I quickly get rid of some entries in a given vector x and
> automatically resize the resulting vector?
> Basically if "I" is a vector of indeces I want to perform something like
>
> x[I] = []
>
> e.g. in Matlab:
>
> >> x=[1,2,3,4,5];
> >> x([2,3])=[]
>
> x =
>
> 1 4 5
>
>