How to convert Nan to zero
932 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Abdulaziz
el 25 de Ag. de 2013
Comentada: Walter Roberson
el 24 de Dic. de 2021
Hi guys; Please I need urgent help
I have matrix of experiment data in excel file, this excel matrix has some blank cells The problem is that the blank element shows as NaN when import the matrix to matlab for processing. Is there any function or .. to convert the Nan to zero
I appreciate your help.
0 comentarios
Respuesta aceptada
Laurent
el 25 de Ag. de 2013
To set all NaN in Q to zero:
Q(isnan(Q))=0;
Is that what you need?
5 comentarios
Más respuestas (2)
Santosh Shakya
el 24 de Dic. de 2021
i want to replace nan with 0 in an array
can you help me?
1 comentario
Walter Roberson
el 24 de Dic. de 2021
a = rand(5,5)
a([2, 7, 23]) = nan
b = fillmissing(a, 'constant', 0)
%OR
c = a; c(isnan(c)) = 0
Ver también
Categorías
Más información sobre Tables en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!