How to convert Nan to zero
Afficher commentaires plus anciens
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.
Réponse acceptée
Plus de réponses (2)
Santosh Shakya
le 24 Déc 2021
2 votes
i want to replace nan with 0 in an array
can you help me?
1 commentaire
a = rand(5,5)
a([2, 7, 23]) = nan
b = fillmissing(a, 'constant', 0)
%OR
c = a; c(isnan(c)) = 0
Hernan Larriva
le 30 Juil 2019
1 vote
Great, Thank you from Barcelona
Catégories
En savoir plus sur Data Preprocessing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!