Вы находитесь на странице: 1из 1

– . The String property contains the menu items as a cell array of strings.

– Using Only the Index of the Selected Menu Item

– This example retrieves only the index of the item selected. It uses a switch
statement to take action based on the value. If the contents of the pop-up menu
are fixed, then you can use this approach. Else, you can use the index to retrieve
the actual string for the selected item.

– function popupmenu1_Callback(hObject, eventdata, handles

– enu

– When the pop-up menu Callback is triggered, the pop-up menu Value property
contains the index of the selected item, where 1 corresponds to the first item on the
menu. The String property contains the menu items as a cell array of strings.

– Using Only the Index of the Selected Menu Item

– This example retrieves only the index of the item selected. It uses a switch statement
to take action based on the value. If the contents of the pop-up menu are fixed, then
you can use this approach. Else, you can use the index to retrieve the actual string for
the selected item.

function popupmenu1_Callback(hObject, eventdata, handles

Вам также может понравиться