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

1 回表示 (過去 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 Center および File ExchangeLogical についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by