how to delete value from one vector such that the subsequent value in other two vectors also gets deleted?
1 回表示 (過去 30 日間)
古いコメントを表示
Hello,
I have three column vectors of same sizes. I want to remove values 8 9 10 from the one vector (B) such that the subequent values in other two vectors (A and C) also get deleted. Similarly, I want to remove values 8 9 10 from vector C such that the subsequent values in other two vectors (A and B) also get deleted (means whole row gets deleted). How to perform this task?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/761871/image.jpeg)
0 件のコメント
回答 (1 件)
Walter Roberson
2021 年 10 月 8 日
mask = ismember(YourArray(:,2), [8 9 10]) | ismember(YourArray(:,3), [8 9 10]);
NewArray = YourArray(~mask, :);
参考
カテゴリ
Help Center および File Exchange で Author Block Masks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!