필터 지우기
필터 지우기

how to get numerical values as well as texts in a single matrix after reading data from a excel file ?

조회 수: 2 (최근 30일)
[num,txt]=xlsread(filename,sheet) here num contains all numerical value and nan (not a number)and txt contains all the texts.now ,how can i replace these nan elements in num by the elements of txt?

채택된 답변

Star Strider
Star Strider 2015년 5월 18일
The easiest way (not having your file to test this on) is to add a third output to xlsread:
[num,txt,raw]=xlsread(filename,sheet)
The ‘raw’ output should have everything just as the function imported it.
  댓글 수: 3
rashmi am
rashmi am 2015년 5월 18일
i just found how to do it
for k = 1:numel(C)
if isnan(C{k})
C{k} = '';
end
end
this works. thank u

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by