function choice = mymenu(cellofoptions,title_)

    d = dialog('Units','centimeters','Position',[15 15 8 8],'Color',[0,0,.8],'Name','Select One');
    if nargin<2
    txt = uicontrol('Units','centimeters','Parent',d,...
           'Style','text',...
           'FontSize',20,...
           'BackgroundColor',[1,1,1],'Position',[15 8 8 2],...
           'String','Select an option');
    else
            txt = uicontrol('Units','centimeters','Parent',d,...
           'Style','text',...
           'FontSize',20,...
           'BackgroundColor',[1,1,1],'Position',[2 15 8 2],...
           'String',title_);
    end
        
    popup = uicontrol('Units','centimeters','Parent',d,...
           'Style','popup',...
           'BackgroundColor',[0,.8,0],'Position',[2 3 4 2],...
           'ForegroundColor',[0,0,0],...
           'String',cellofoptions,...
           'Callback',@popup_callback);
       
    btn = uicontrol('Units','centimeters','Parent',d,...
           'Position',[2 1 4 2],...
           'BackgroundColor',[1,1,0],...
           'String','GO!',...
           'FontSize',14,...
           'Callback','delete(gcf)');
       
    choice = cellofoptions{1};
       
    % Wait for d to close before running to completion
    uiwait(d);
   
       function popup_callback(popup,event)
          idx = popup.Value;
          popup_items = popup.String;
          % This code uses dot notation to get properties.
          % Dot notation runs in R2014b and later.
          % For R2014a and earlier:
          % idx = get(popup,'Value');
          % popup_items = get(popup,'String');
          choice = char(popup_items(idx,:));
       end
end