how to delete rows from a struct array?
显示 更早的评论
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 !!!

回答(1 个)
Bob Thompson
2019-3-7
0 个投票
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.
类别
在 帮助中心 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!