Delete rows or column with NaN for a cell array

8 visualizaciones (últimos 30 días)
Farshid Daryabor
Farshid Daryabor el 17 de Feb. de 2020
Respondida: Pruthvi G el 12 de Mzo. de 2020
I really thanks in advance any help. How can I delete NaN's of column from the cell attached as example file here.
Thanks

Respuesta aceptada

Bhaskar R
Bhaskar R el 17 de Feb. de 2020
nan_loc = cellfun(@(x)any(isnan(x)), P_QC, 'UniformOutput', false);
for ii=1:length(P_QC)
P_QC{ii}(:,nan_loc{ii}) = [];
end
  4 comentarios
Bhaskar R
Bhaskar R el 17 de Feb. de 2020
Yeah, same applicable for lon

Iniciar sesión para comentar.

Más respuestas (1)

Pruthvi G
Pruthvi G el 12 de Mzo. de 2020
Data(cellfun(@(cell) any(isnan(cell(:))),Data))={''};

Categorías

Más información sobre Characters and Strings 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