Delete rows from cell array

4 ビュー (過去 30 日間)
David du Preez
David du Preez 2016 年 7 月 1 日
コメント済み: David du Preez 2016 年 7 月 1 日
I have a cell array of 11x8761 and I want to delete entire rows when the value in column 9 or 6 are equal to []. How do I delete the rows without deleting the entire column as well?

採用された回答

Guillaume
Guillaume 2016 年 7 月 1 日
emptycells = cellfun(@isempty, yourcellarray); %find empty cells in the whole cell array
yourcellarray(any(emptycells(:, [6 9]), 2), :) = []; %remove rows for which any of column 6 or 9 is empty
  1 件のコメント
David du Preez
David du Preez 2016 年 7 月 1 日
Thanks Guillaume that works.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCell Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by