How to read a line in atxt file with different formats?

1 Ansicht (letzte 30 Tage)
Mia
Mia am 6 Dez. 2016
Beantwortet: KSSV am 6 Dez. 2016
I need to import a row vector printed in a txt file. The line contains a word, followed by the numerical values of a vector. Problem is I don't know how to read a row vector without knowing it's length in advance. I've tried using textscan:
textscan(fid,['word' ,repmat('%f',[1,inf])]);
This obviously does not work. Would appreciate any ideas regarding reading a row vector. Thanks in advance

Antworten (1)

KSSV
KSSV am 6 Dez. 2016
data = importdata('yourfile.txt') ;
num = data.data ;

Kategorien

Mehr zu Data Import and Analysis 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