How to display entries of a vector with exclusion?
古いコメントを表示
Say I have a vector V, and a set A whose elements are indexes.
How to show elements of V excluding indexes from A?
Example: V={1 4 6 5 8 11 25 36} A = {2 3 6}
I need to display {1 5 8 25 36}.
I know I can make them zero or remove them. But I don't want to do that way because I will use them later, also I want to display several times so it's bad to change the size or those values.
Thank you.
採用された回答
その他の回答 (1 件)
Chandrasekhar
2014 年 3 月 20 日
for i = 1:length(A)
idx = A{i}-i;
V(idx) = [];
end
カテゴリ
ヘルプ センター および File Exchange で Operators and Elementary Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!