How can I add a header line to the following code (header for txt output):
O = [2,1;4,6;2,10;6,800];fid = fopen('Output.txt', 'wt');fprintf(fid, [repmat('%g\t', 1, size(O,2)-1) '%g\n'], O.');fclose(fid)
For example:
Header1 Header2
fprintfMATLABmatrixoutput
O = [2,1;4,6;2,10;6,800];fid = fopen('Output.txt', 'wt');fprintf(fid, [repmat('%g\t', 1, size(O,2)-1) '%g\n'], O.');fclose(fid)
Header1 Header2
Best Answer