How to delete the row that contains specific string on the cells

4 次查看(过去 30 天)
Hi, I have an array of 80x2, and I would like to delete the rows only if both cells in a row contain the string 'N/A'. Attached is an example of the first 24 rows. The idea is I hope the code can find out which rows contain 2 'N/A', and then delete that corresponding row.

采纳的回答

Walter Roberson
Walter Roberson 2016-1-12
row_to_delete = all( cellfun(@(C) ischar(C) && strcmp(C,'N/A'), YourCell), 2);
YourCell(row_to_delete, :) = [];

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by