user2212532
user2212532

Reputation: 23

Write exponents in MATLAB GUI pop-up menu

Is there any way I can write exponents other than ² and ³ as part of a string in a MATLAB GUI popup menu?

Upvotes: 2

Views: 614

Answers (2)

fatihk
fatihk

Reputation: 7919

You can just type [number]^[power], it will automatically cast as power notation

Upvotes: 1

Jonas
Jonas

Reputation: 74940

Matlab uicontrols support HTML.

Thus, you can create a popup menu with arbitrary exponents like so (just set the string property if you have created it via GUIDE):

fh = figure;
uicontrol('style','popupmenu','parent',fh,'units','normalized','position',[0.2 0.2 0.4 0.4],...
   'string','<html>text<sup>exp</sup></html>') 

Upvotes: 1

Related Questions