MATLAB: TeX problem — why

tex

This is working
gtext('\Sigma')
gtext('\color {red} 5')
This is not working
gtext('\frac{1}{2}')
gtext('\sqrt(5)')
Why??

Best Answer

MATLAB's TeX does not support those. However, these two will work:
gtext('$\frac{1}{2}$','interpreter','latex','fontsize',50)
gtext('$\sqrt{5}$','interpreter','latex','fontsize',50)
To find out more about tex/latex support in MATLAB, look here:
Related Question