why does xlsread deletes NaN for cells with text?
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
when applying xlsread for an excel sheet with both numbers and text, xlsread deletes the cells that contains text instead of writing NaN. How can i avoid this? I want it to write NaN so i can use isnan()=0
댓글 수: 0
답변 (1개)
Andrei Bobrov
2013년 3월 4일
편집: Andrei Bobrov
2013년 3월 4일
use
[~,~,c] = xlsread(...)
eg
[~,~,c] = xlsread('yourfile.xlsx')
out = zeros(size(c))
lc = cellfun(@(x)ischar(x),c);
out(lc) = nan;
out(~lc) = [c{~lc}];
댓글 수: 0
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!