import multi type data in MATLAB

2 ビュー (過去 30 日間)
SARAH ZAVAREH
SARAH ZAVAREH 2011 年 6 月 29 日
How I can import a text file in MATLAB including 256 columns: first column is string and other columns are numeric data.

採用された回答

Gerd
Gerd 2011 年 6 月 29 日
Hi Sarah,
depending on your specific file you can use
fid= fopen('File.txt');
textscan(fid,'%s%f.....');
fclose(fid);
Gerd
  6 件のコメント
Jan
Jan 2011 年 6 月 29 日
Data = textscan(fid,['%s' repmat('%f',1,255)]);
Then Data is a cell, which contains the different columns as elements. See "help textscan".
SARAH ZAVAREH
SARAH ZAVAREH 2011 年 6 月 29 日
Thank you all, it works :)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeText Files についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by