User`s guide

Add Components to the GUI
The popup’s callback controls its behavior. GUIDE generates this much of
the callback.
function popupm enu1 _Callback(hObject, eventdata, handles)
% hObject handle to popupmenu1 (see GCBO)
% eventdata re serv ed - to be defi ned in a future ver sion of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = get(hOb ject,'String') returns popupmenu1
% contents as cell array
% contents{get(hObject,'Value')} returns selected ite m
% from popupmen u1
The callbacks’s code adds these statements.
contents = get(hObject, 'Str ing');
selectedText = contents{get(h Obje ct,'Value')};
colormapStatus = [selectedText ' colormap'];
set(handles.textStatus, 'string', colormapStatus);
colormap(selectedText)
The String data is retrieved as a cell array and assigned to contents.The
Value property indexes the member of contents that the user just selected to
6-29