MATLAB: Problem with “Warning: Unable to interpret TeX string” message

figureinterpretxlabel

Hello all,
I want to create a figure in Matlab with xlabel "Time (h)", with fontname "Times" and fonsize "20". So my Matlab script for this is :
"xlabel('\fontname{Times} \fonsize{20} Time (h)')"
But when I run my routine I get the following warning message :
"Warning: Unable to interpret TeX string "\fontname{Times} \fonsize{20} Time (h)" "
And what I get under the x-axis is "\fontname{Times} \fonsize{20} Time (h)" whereas what I want is "Time (h)".
Can you help me ?

Best Answer

You made a typing mistake
xlabel('\fontname{Times} \fontsize{20} Time (h)')
You missed the 't' in 'fontsize'
Related Question