why does xlsread deletes NaN for cells with text?
Info
This question is closed. Reopen it to edit or answer.
Show older comments
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
Answers (1)
Andrei Bobrov
on 4 Mar 2013
Edited: Andrei Bobrov
on 4 Mar 2013
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}];
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!