Hi,
you can use textscan for this task:
fid = fopen('yourfile.txt', 'rt');
firstHeader = fgetl(fid);
secondHeader = fgetl(fid);
tokens = textscan(secondHeader, '%s');
rows = str2double(tokens{1}{end});
aData = textscan(fid, '%g', 4*rows);
data = reshape(aData{1}, 4, rows)';
and then you continue to do this in a loop (with result data{iLoop} = reshape(aData...) until you reach the end of the file (e.g. firstHeader is 0 instead of a string.
Titus
Best Answer