I'd like to run a single fprintf operation to print to both command window and file.
I know that the below command only print to 'log.txt' file:
fid = fopen('log.txt', 'w');fprintf(fid, 'start logging\n');
And below will only print to command window:
fprintf('start logging\n');
Is there a way to print to both without calling fprintf twice?
Thanks,
Best Answer