Filter löschen
Filter löschen

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

2 Ansichten (letzte 30 Tage)
[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?

Akzeptierte Antwort

Star Strider
Star Strider am 18 Mai 2015
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 Kommentare
rashmi am
rashmi am am 18 Mai 2015
i just found how to do it
for k = 1:numel(C)
if isnan(C{k})
C{k} = '';
end
end
this works. thank u

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by