Delete rows or column with NaN for a cell array

조회 수: 10 (최근 30일)
Farshid Daryabor
Farshid Daryabor 2020년 2월 17일
답변: Pruthvi G 2020년 3월 12일
I really thanks in advance any help. How can I delete NaN's of column from the cell attached as example file here.
Thanks

채택된 답변

Bhaskar R
Bhaskar R 2020년 2월 17일
nan_loc = cellfun(@(x)any(isnan(x)), P_QC, 'UniformOutput', false);
for ii=1:length(P_QC)
P_QC{ii}(:,nan_loc{ii}) = [];
end
  댓글 수: 4
Bhaskar R
Bhaskar R 2020년 2월 17일
Yeah, same applicable for lon
Farshid Daryabor
Farshid Daryabor 2020년 2월 17일
Thanks

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Pruthvi G
Pruthvi G 2020년 3월 12일
Data(cellfun(@(cell) any(isnan(cell(:))),Data))={''};

카테고리

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