% fprintf example: Open file 'foo.dat' for *append* (i.e. so 
% data is appended to end of file, then output vector v in 
% comma-delimited format, so that the file can be read into Excel
% or OpenOffice.
fid = fopen('foo.dat', 'a+');
v = rand(1,96);
disp(fid);
fprintf(fid, '%g,', v);
fprintf(fid, '\n');
fclose(fid);
