%% Read Text File One Character At a Time
% Read one character at a time from bench.dat, which contains MATLAB® benchmark data. Open the file, read until end-of-file is reached, and then close the file.

fid = fopen('bench.dat');

k = 0;
while ~feof(fid)
    curr = fscanf(fid,'%c',1);
    if ~isempty(curr)
       k = k+1;
       benchstr(k) = curr;
    end
end
    
fclose(fid);

% Copyright 2012 The MathWorks, Inc.