do

  WelcomeMessage = 'Welcome';

  MenuMessage = 'What would you like to do?';
  Option1Message = 'sin(x)';
  Option2Message = 'cos(x)';
  OptionBackMessage = 'Back';
  OptionExitMessage = 'Exit';


  bContinueCreatePlotsMainLoop = 1;

  clc
  disp(WelcomeMessage)
  MenuResponse = menu(MenuMessage, Option1Message, Option2Message, OptionBackMessage, OptionExitMessage);

  switch (MenuResponse)
  case 1
    figure; clf
    x = [0:pi/120:2*pi]';
    y = sin(x);
    plot(x,y);
 case 2
   figure; clf
   x = [0:pi/120:2*pi]';
   y = cos(x);
   plot(x,y);
 case 3
   bContinueCreatePlotsMainLoop = 0;
 case 4
   bContinueCreatePlotsMainLoop = 0;
 endswitch

 drawnow
until (bContinueCreatePlotsMainLoop == 0)



