how to delete rows from a struct array?
1 回表示 (過去 30 日間)
古いコメントを表示
hello folks I have this struct array as shown bellow i'd like to delete all the rows where class is not 'double', so i'm wondering how to ? anyone can help !!!

0 件のコメント
回答 (1 件)
Bob Thompson
2019 年 3 月 7 日
vars = vars([vars.class] == 'double');
This may not work exactly (I think you might need to use strcmp instead of ==, but it should get you going.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Structures についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!