【问题标题】:How do I remove elements at a set of indices in a vector in MATLAB?如何在 MATLAB 中删除向量中一组索引处的元素?
【发布时间】:2011-04-16 22:23:48
【问题描述】:

我有一个包含 100 个元素的向量。我有另一个向量,其中包含要从该向量中删除的元素的索引位置。

我该怎么做?

【问题讨论】:

标签: arrays matlab matrix matrix-indexing


【解决方案1】:
vector(indecies) = []

示例:

>> a = 1:10;
>> a([3,4,7]) = []

a =

     1     2     5     6     8     9    10

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-28
    • 1970-01-01
    • 2013-12-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多