Replace missing cell entries without replacing whitespaces.
이전 댓글 표시
I'm reading an excel file using readcell, and all empty cells are imported as 'missing'.
I would like to replace the missing, and i found the following suggestions (cellfun+anonymous function)
https://www.mathworks.com/matlabcentral/answers/473295-how-to-replace-missing-values-in-a-cell-array
However, this solution also marks whitespaces as missing and replaces them
A = {1, 'test123', 2, 1, 'texthere';2, 'test456', 3 ,4, missing;...
3, 'test789', missing, 1, 'text with spaces'}
A(cellfun(@(x) any(ismissing(x)), A)) = {'REPLACED'}
In this example, I would like 'text with spaces' to be left alone, and only to replace the actual 'missing' cells. How do I achieve this?
Thanks!
채택된 답변
추가 답변 (1개)
카테고리
도움말 센터 및 File Exchange에서 Text Files에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!