필터 지우기
필터 지우기

Delete rows from cell array

조회 수: 2 (최근 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 CenterFile Exchange에서 Cell Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by