MATLAB: Printing to screen with fprintf. Reclaim back the printed result after clearing the screen.

clcfprintfprint

Suppose I use the fprintf as follows:
name='John';
height=1.8;
age=27;
fprintf('Name.............%s\n\n', name);
fprintf('Height...........%.2f m\n',height);
fprintf('Age..............%d \n',age);
Is there any way to reclaim the printed result after clearing the screen with:
clc

Best Answer

The results of fprintf() to the screen do not exist in the workspace, and are not obtainable through normal graphics routines.
However, I have not researched the advanced editor and command line capabilities that were added a couple of releases ago, so I hesitate to give a blanket "no". Maybe there would be a way to request a copy of what is in the command window just before you issue the clc(), and then re-output it after you issue the clc(). I'd be relatively sure you could not have this happen automatically whenever a clc() was issued (not without overriding the normal clc)
Related Question