import multi type data in MATLAB

1 Ansicht (letzte 30 Tage)
SARAH ZAVAREH
SARAH ZAVAREH am 29 Jun. 2011
How I can import a text file in MATLAB including 256 columns: first column is string and other columns are numeric data.

Akzeptierte Antwort

Gerd
Gerd am 29 Jun. 2011
Hi Sarah,
depending on your specific file you can use
fid= fopen('File.txt');
textscan(fid,'%s%f.....');
fclose(fid);
Gerd
  6 Kommentare
Jan
Jan am 29 Jun. 2011
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 am 29 Jun. 2011
Thank you all, it works :)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Large Files and Big Data finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by