Delete NaN in arrays in a cell

4 ビュー (過去 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 Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by