How to delete rows from a CELL with certain values?
1 次查看(过去 30 天)
显示 更早的评论
It has thousands of rows and I want to remove any row with 0 or 99 or 999 in the row 12 and 13
0 个评论
采纳的回答
Jos (10584)
2016-6-9
Similar question, similar answer ...
You should be able to modify the code from that one!
If you do not understand it, just ask for some more explanation...
2 个评论
Jos (10584)
2016-6-9
Fair enough. You can select the columns first:
A_selected = A(:, [ 12 13]) ;
tf = ~any(cellfun(@(x) isequal(x,0) || isequal(x,99),A_selected, 'un',1),2) ;
B = A(tf,:) ;
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!