"Aaronne" wrote in message <jsa3oa$a7l$
1...@newscl01ah.mathworks.com>...
Just look at what the code you posted is doing. It finds each uicontrol with the "latex" tag. Then it deletes it (actually does this towards the end), and replaces it with an invisible axes that contains a text object that displays the desired text. Here is an example contrasting the two approaches:
f=figure
%uicontrols can't display latex:
u=uicontrol('units','pixels','position',[20 200 200 24],...
'style','text','string','I can''t display \pi',...
'horiz','left',...
'backgroundcolor',get(f,'color'));
%but text objects can:
axes('units','pixels','position',[20 100 200 24],'visible','off')
text(0,0.5,'I can display $\pi$','interpreter','latex',...
'horiz','left','vert','middle')