C'est moins simple qu'il n'y parait…

Une solution :


fid = fopen('data.txt', 'rt');

numBlock = 1;
numLine = 0;
n = 0;