Undocumented Secrets of MATLAB
®
-Java Programming488
then modify its style — for some unknown reason MATLAB rst needs to place the relevant
segment in a “styled” mode (or something similar). I tried to fprintf(2,text) to set the red (error)
style, but this did not help. But when I prepended a simple hyperlink space character I got what I
wanted — I could now modify the subsequent text to any of the predened syntax highlighting
colors/styles.
But is it possible to use any user-dened colors, not just the predened syntax highlighting
colors? I then remembered my earlier discovery that “Colors_M_Strings” and friends are sim-
ply system preference color objects that can be updated:
import com.mathworks.services.*
Prefs.setColorPref('Colors_M_Strings',java.awt.Color(. ...