removing cells containing Inf or NaNs

1 回表示 (過去 30 日間)
Christos
Christos 2012 年 12 月 24 日
Hi folks. I have a cell array, each cell containing a column vector. Is there any way to check if a cell contains inf or nans and if so deleting them? I.e if cell{3}=[inf;inf;1;2] then i want to remove it.
Thanks.

採用された回答

Walter Roberson
Walter Roberson 2012 年 12 月 24 日
YourCellArray( cellfun( @(C) any(isnan(C) | isinf(C)), YourCellArray ) ) = [];
  1 件のコメント
Christos
Christos 2012 年 12 月 24 日
Thnx a lot!

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

その他の回答 (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