How to write a text header in text file? for example in the example below, how to write the header code salay month
just once?
Code Salary Month
12 1000 12
14 1020 11
11 1212 9
The code:
fid = fopen('analysis1.txt','wt');
for i=1:10
array = []; % empty the array
....
array = [code salary month];
format short g;
fprintf(fid,'%g\t %g\t %g\n',array); % write to file
end
fclose(fid);
Is there any reason for not using simple solution like following?
Thanks, Here is a script I modified to generate one variable file,
Just to make it easy to copy and paste
Jaap