readtable excel decimal NaN
조회 수: 2 (최근 30일)
이전 댓글 표시
I use readtable to get access to excel data
some cells in the excell file contain no data and instead have a decimal point,
how can I replace these cells with NaN
regards
Johannes
댓글 수: 2
답변 (1개)
Priysha LNU
2020년 11월 11일
Hi,
Try using the following code:
[m,n] = size(Data) %gives number of rows and columns in 'Data'
for i = 1:m
for j = 1:n
if strcmp(Data{i,j},'.') %check if cell content is "."
Data{i,j} = NaN %replace with NaN
end
end
end
DISCLAIMER: These are my own views and in no way depict those of MathWorks.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!