필터 지우기
필터 지우기

Delete NaN in arrays in a cell

조회 수: 3 (최근 30일)
Rudolf
Rudolf 2021년 5월 6일
댓글: Rudolf 2021년 5월 6일
I have a 1x20 cell containing 20 arrays of double. Some of these arrays contains NaN. How can i delete them?
(If an array of double with 1 NaN is 101 long, it should be 100 after) Hope i explained it good enough.

채택된 답변

KSSV
KSSV 2021년 5월 6일
Let C be your cell array;
iwant = C ;
for i = 1:length(C)
idx = isnan(C{i}) ;
iwant{i} = C{i}(~idx) ;
end
  댓글 수: 1
Rudolf
Rudolf 2021년 5월 6일
Fantastic, thank you!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by