Matlab Tip: Change the color-scheme to be easier on your eyes

Screen Shot 2013-02-08 at 1.01.07 PMHey Matlab users, here's a quick tip that I hope is helpful.  If you stare at MATLAB for long hours, espically late at night, then changing your color scheme is a quick an easy way to reduce eye strain (and maybe help you sleep better).

Our eyes never evolved to stare at a bright white light all day, and research shows that looking at bright light before going to bed is bad for sleep.

Screen Shot 2013-02-12 at 3.37.59 PMJust head to "Matlab-> Preferences" and select the colors menu to get started!  I prefer a green text on a dark background, but even a sepia background will be easier on the eyes than Bright White.  A great scheme is called "Solarized" which you can set MATLAB to match.  It offers a warm look that looks great with dark or light backgrounds. A great thing about this theme is when switching from Dark to Light backgrounds, you don't need to change any of the other colors: They're designed to look good on both backgrounds.

To change the colors via the terminal, you can use commands outlined in another cool MATLAB blog.  To get you started on the Solarized color scheme that I like, use:

com.mathworks.services.Prefs.setBooleanPref('ColorsUseSystem',0);
com.mathworks.services.Prefs.setColorPref('ColorsBackground',java.awt.Color(7/255,54/255,66/255));
com.mathworks.services.Prefs.setColorPref('ColorsText',java.awt.Color(133/255,153/255,0/255));
com.mathworks.services.Prefs.setColorPref('Colors_M_Comments',java.awt.Color(181/255,137/255,0/255));
com.mathworks.services.Prefs.setColorPref('Colors_M_Keywords',java.awt.Color(38/255,139/255,210/255));
com.mathworks.services.Prefs.setColorPref('Colors_M_Strings',java.awt.Color(42/255,161/255,152/255));

(Note: You'll have to restart Matlab after running these commands for them to take effect)