M-File Help: multidfprintf | View code for multidfprintf |
Print formatted text to multiple streams
COUNT = MULTIDFPRINTF(IDVEC, FORMAT, A, ...) performs formatted output to multiple streams such as console and files. FORMAT is the format string as used by sprintf and fprintf. A is the array of elements, to which the format will be applied similar to sprintf and fprint.
IDVEC is a vector (1xN) of file descriptors and COUNT is a vector (1xN) of the number of bytes written to each file.
% Create and open a new example file: fid = fopen('exampleFile.txt','w+'); % Write something to the file and the console simultaneously: multidfprintf([1 FID],'% s % d % d % d!\n','This is a test!',1,2,3); % Close the file: fclose(FID);
Joern Malzahn, (joern.malzahn@tu-dortmund.de)
© 1990-2014 Peter Corke.