フィルターのクリア

Generic index select, without loops

1 回表示 (過去 30 日間)
Elad Karas
Elad Karas 2017 年 12 月 14 日
回答済み: KL 2017 年 12 月 14 日
Hello, I have a given vector V1 and I need to create another vector, V3 which based of all other indexes of V1 that are not in V2 (input vector). Example : V1=[45 23 26 17 29]; input=> V2=[3 5] ; output=> V3=[45 23 17]. The thing is I need to make it without loops. Thank you !

採用された回答

KL
KL 2017 年 12 月 14 日
V1=[45 23 26 17 29];
V2=[3 5] ;
V3 = V1(~ismember(V1,V1(V2)))
V3 =
45 23 17

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by