MATLAB: Matlab title with different colors on the string

axiscolorplot

How do I specify different font colors on the same string using the TEXT, TITLE, XLABEL, YLABEL, or ZLABEL commands in Matlab 8.2(R2013b)?
A previous solution for ver 2009a suggested using this as an example:
title(['\fontsize{16}black {\color{magenta}magenta '...
'\color[rgb]{0 .5 .5}teal \color{red}red} black again'])
…which does not work anymore. Any help will be appreciated.

Best Answer

I just tried your suggested solution and it works on 2012b and 2014b. Is it an issue with the interpreter? Try specifying
title(['\fontsize{16}black {\color{magenta}magenta ','\color[rgb]{0 .5 .5}teal \color{red}red} black again'],'interpreter','tex')