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에서 Data Preprocessing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!