From the details you provided about the shape of your text-file I'm guessing it has the following form :
label1 info1 text1 1 1.1 3.1
label2 info2 text2 2 2.1 3.2
lebel3 info3 text3 3 3.1 3.3
...
You can load all this data using a loop and the fscanf
function and simple loops.
If N
is the number of lines of your text-file the following code might work for you:
f=fopen('test.txt');
for k=1:N
for i=1:3
a{k,i} = fscanf(f,'%s',1);
end
b(k,:) = fscanf(f,['%f' '%f' '%f'],3);
end
fclose(f);
Then you will have one cell-array of strings a
:
a =
'label1' 'info1' 'text1'
'label2' 'info2' 'text2'
'lebel3' 'info3' 'text3'
And one array with numeric data b
:
b =
1.0000 1.1000 3.1000
2.0000 2.1000 3.2000
3.0000 3.1000 3.3000
In order to get further information I advise you to read this page.