Read text file containing string and numeric data

1 回表示 (過去 30 日間)
Debanjan Goswami
Debanjan Goswami 2012 年 11 月 15 日
回答済み: Abirami M 2020 年 3 月 11 日
I would like read the following text file that has column values with string and numeric data. Problem is the numeric column is mixed with 'N/A'. After reading, I like to use data from column 8 and 11. I'm using R2010b.

採用された回答

Matt Fig
Matt Fig 2012 年 11 月 15 日
fid = fopen('Test.txt');
C = textscan(fid,repmat('%s',1,19),'Headerlines',1)
fclose(fid)
HeadDiam = str2double(C{8});
TYPE = C{11};
Note that when using STR2DOUBLE, those N/As are converted to NaNs
  1 件のコメント
Debanjan Goswami
Debanjan Goswami 2012 年 11 月 15 日
cool! thanks a lot

サインインしてコメントする。

その他の回答 (1 件)

Abirami M
Abirami M 2020 年 3 月 11 日
Use this Url and how to read and preprocess this kind of text data in matlab.

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by