Thanks for the improvement, Thierry! The 'cellfun(@fcn, ...)' method, though elegant, unfortunately doesn't work on Matlab 6.x (which some of us still have to use. Sigh.)
This is great! I wish Matlab documented its Java innards better. Anyway, there seems to be another small bug.
fprintf('Here: ')
cprintf('blue', 'Blue\n');
results in a blue underscore followed by the word 'Blue' in white (invisible on white background of my command window - but shows up when highlighted).
However, the same code as above, only using '-blue' instead of 'blue', works fine (gives the expected underlined blue text).