removing cells containing Inf or NaNs

2 vues (au cours des 30 derniers jours)
Christos
Christos le 24 Déc 2012
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.

Réponse acceptée

Walter Roberson
Walter Roberson le 24 Déc 2012
YourCellArray( cellfun( @(C) any(isnan(C) | isinf(C)), YourCellArray ) ) = [];
  1 commentaire
Christos
Christos le 24 Déc 2012
Thnx a lot!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Cell Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by