%Lecture 4
fid = fopen('grades.txt','r');
scores = fscanf(fid, '%*s %g %g', [2 inf]);
scores = scores';

count = size(scores,1);
for i = 1:count
    ave = (scores(i,1) + scores(i,2))/2;
    fprintf('%i %g \n', i, ave);
end
fclose(fid);