Borrar filtros
Borrar filtros

removing cells containing Inf or NaNs

3 visualizaciones (últimos 30 días)
Christos
Christos el 24 de Dic. de 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.

Respuesta aceptada

Walter Roberson
Walter Roberson el 24 de Dic. de 2012
YourCellArray( cellfun( @(C) any(isnan(C) | isinf(C)), YourCellArray ) ) = [];

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by