Don't show "NaN" in uitable ,if there not value in a table cell.

10 visualizaciones (últimos 30 días)
CoderMinga
CoderMinga el 7 de Sept. de 2022
Comentada: CoderMinga el 9 de Sept. de 2022

Respuesta aceptada

Ankit
Ankit el 9 de Sept. de 2022
Below method will remove NaN with a variable as ' '. But for this you need to convert your array it into cell array first
A = [1 2 NaN 3 4 NaN 5] ;
Acell = num2cell(A);
idx = cellfun(@(C) all(isnan(C)), Acell);
Acell(idx) = {' '};

Más respuestas (1)

KSSV
KSSV el 7 de Sept. de 2022
You can remove the NaN's using isnan.
A = [1 2 NaN 3 4 NaN 5] ;
A(isnan(A)) = []
A = 1×5
1 2 3 4 5
  1 comentario
CoderMinga
CoderMinga el 9 de Sept. de 2022
The method you described can only delete the NaN ,but I want use a space to instead of NaN

Iniciar sesión para comentar.

Categorías

Más información sobre NaNs 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