2

I want to write Greek characters and equations in textbox (Static Text) of Matlab GUI. Is it possible to write? I tried Latex $\eta { x }^{ 2 }+c$ but nothing changes. It displays the same.

newzad
  • 706
  • 1
  • 14
  • 29
  • When you say "it displays the same", do you mean you just see the Latex? If so, you probably want to look at the `Interpreter` property of `text` objections: http://www.mathworks.co.uk/help/matlab/ref/text_props.html – devrobf May 24 '13 at 17:08
  • yes it displays Latex. Thank you for the link. – newzad May 24 '13 at 17:19
  • MatLAb GUI controls do not render LaTeX strings. See here for more details: http://stackoverflow.com/questions/16271543/how-to-render-expressions-in-matlab-gui/ – anandr May 24 '13 at 17:29

1 Answers1

1

Unfortunately it seems Matlab doesn't use the same text drawing methods on graphs, which support LaTeX, as it does on GUI elements. Here is a webpage explaining a workaround: http://undocumentedmatlab.com/blog/customizing-matlab-labels/

Basically, you will need to manually determine where you want the text to be on your GUI in terms of pixel position, and length, and rewrite your equation in HTML instead of LaTeX.

In the GUIDE interface for your GUI, you will need to click the "Editor" button on the toolbar menu, and find the section:

function initialize_gui(fig_handle, handles, isreset)

You'll want to insert your labeling code before the:

% Update handles structure
guidata(handles.figure1, handles);
Geoff
  • 21
  • 3