How to convert Nan to zero
显示 更早的评论
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.
采纳的回答
更多回答(2 个)
Santosh Shakya
2021-12-24
2 个投票
i want to replace nan with 0 in an array
can you help me?
1 个评论
a = rand(5,5)
a([2, 7, 23]) = nan
b = fillmissing(a, 'constant', 0)
%OR
c = a; c(isnan(c)) = 0
Hernan Larriva
2019-7-30
1 个投票
Great, Thank you from Barcelona
类别
在 帮助中心 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!