How to delete specific rows in a table based on a value?
44 ビュー (過去 30 日間)
古いコメントを表示
Hi all,
I have a big table with 6 columns and would like to delete all rows where one column contains a specific value.
That's how the table looks like:

I would like to delete all rows, where T.ISIN == 'DE0006205701'
May you please help me with this?
Thanks so much in advance!
5 件のコメント
採用された回答
その他の回答 (1 件)
Image Analyst
2020 年 12 月 13 日
Did you try ismember like I suggested above?
s = load('answers.mat')
T = s.T;
whos T % Show size.
% I would like to delete all rows, where T.ISIN == 'DE0006205701'
pattern = 'DE0006205701'
[ia, ib] = ismember(T.ISIN, {pattern});
fprintf('Found %d rows where ISIN = "%s". We will delete those.\n', sum(ia), pattern);
T(ia, :) = [];
whos T % Show size now.
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!