How to convert Nan to zero
조회 수: 728 (최근 30일)
이전 댓글 표시
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
채택된 답변
추가 답변 (2개)
Santosh Shakya
2021년 12월 24일
i want to replace nan with 0 in an array
can you help me?
댓글 수: 1
Walter Roberson
2021년 12월 24일
a = rand(5,5)
a([2, 7, 23]) = nan
b = fillmissing(a, 'constant', 0)
%OR
c = a; c(isnan(c)) = 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!