Create context menu component
creates a context
menu in the current figure and returns the cm
= uicontextmenuContextMenu
object. If
a figure does not exist, then MATLAB® calls the figure
function to create one.
To enable the context menu to open in the figure, you must also take these steps:
Assign the context menu to a UI component or graphics object in the same figure.
Create at least one child Menu
object within the
context menu.
creates a context menu with property values specified using one or more name-value
pair arguments. Specify name-value pairs with either of the previous
syntaxes.cm
= uicontextmenu(___,Name,Value
)
To display a context menu interactively in a running app, it must:
Have at least one menu item.
Be assigned to a UI component or graphics object in the same figure.
To open a context menu programmatically, use the open
function. The context menu must be the child of a figure
created with the uifigure
function. To display the context
menu it must have at least one menu item created with the
uimenu
function.