In the following, the menu object needs to first be identified using:
set(handles.data, 'String', 'Data1');
elseif (strcmp(contents{get(hObject,'Value')},'MenuEntry2')),
set(handles.data, 'String', 'Data2');
else
msgbox('Error with menu callback. Parameter passed is not recognised.');
end