Replace NaN with Blanks
이전 댓글 표시
Hi guys I have a double matrix as shown in the attached picture that I am trying to replace all NaN values with Empty spaces so that the over all matrix dimension will be maintained. However, when I looked through the function and suggested solutions non of them is actully working what possible code can be used.

Thanks in advance
댓글 수: 1
David
2024년 6월 5일
This is not a "fix it in Matlab" answer, but I've been generating tables in Matlab to use in Word for example. When I build the table matrix, I insert NaN's in every cell that I want blank. Then in Word, I use "find and replace" to replace all those with something else; i.e., '---'. This idea should work in Excel too, although I've not tested it there.
채택된 답변
추가 답변 (2개)
dpb
2020년 2월 7일
0 개 추천
Can't be done--a double array has to be regular in both dimension; can't have holes.
Only possibility is to convert to a cell array.
Opeyemi Kehinde
2021년 12월 5일
fillmissing(V1, 'constant', [])
will this work to make NaN an empty entry
카테고리
도움말 센터 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!