How do I remove elements at a set of indices in a vector in MATLAB?

后端 未结 1 848
一个人的身影
一个人的身影 2020-12-10 10:17

I have a vector with 100 elements. I have another vector with index positions of elements I want to remove from this vector.

How do I do this?

相关标签:
1条回答
  • 2020-12-10 11:12
    vector(indecies) = []
    

    example:

    >> a = 1:10;
    >> a([3,4,7]) = []
    
    a =
    
         1     2     5     6     8     9    10
    
    0 讨论(0)
提交回复
热议问题