title: Matlab r2015a guide - cannot convert double to a handle
body: <p>In the past , I used Matlab 2013 and this code runs correctly and no errors , but now I use matlab r2015a and  when I run the code, I get the following error: <code>Cannot convert double value -10 to a handle.</code> I checked the Matworks website but the explanation is not very clear. Do you have any suggestion on how to fix this? Thank you so much ! </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function minhhoaxy(action,in1)
  
  global DATA; 
  
  if nargin &lt; 1,
     action='start';
  end;
  
  if strcmp(action,'start'),
  clf reset;
  figure(gcf);
  set(gcf,'Units','normalized','NumberTitle','off', ...
          'Name','Minh hoa GUI','backingstore','on');
  min_x=-10;     
  max_x=10;
  x=0; 
  
  uicontrol('Style','text','Units','normalized',...
           'Position',[.03 .03 .1 .05],...
           'BackgroundColor',[0 0.5 .5],...
           'FontSize',12,'Fontname','VNI-Times',...
           'ForegroundColor','white','String','Vò trí x:',...
           'HorizontalAlignment','center');
  uicontrol('Style','text','Units','normalized',...
           'Position',[.15 .03 .05 .05],...
           'BackgroundColor',[0 0 .5],...
           'FontSize',12,'Fontname','VNI-Times',...
           'HorizontalAlignment','center',...
           'ForegroundColor','white','String',num2str(min_x));   
  x1=uicontrol('Style','slider','Units','normalized',...
           'Position',[.2 .03 .25 .05],...
           'SliderStep',[5.0000e-004 5.0000e-003],...
           'Value',x,'Max',max_x,'Min',min_x,...
           'Callback','minhhoaxy(''setx'',1);minhhoaxy(''redraw'');');
  uicontrol('Style','text','Units','normalized',...
           'Position',[.45 .03 .05 .05],...
           'BackgroundColor',[0 0 .5],...
           'FontSize',12,'Fontname','VNI-Times',...
           'HorizontalAlignment','center',...
           'ForegroundColor','white','String',num2str(max_x));   
  x2=uicontrol('Style','edit','Units','normalized',...
           'Position',[.55 .03 .09 .05],...
           'FontSize',10','Fontname','VNI-Times',...
           'String',num2str(x),...
           'Callback','minhhoaxy(''setx'',2);minhhoaxy(''redraw'')');
  uicontrol('Style','text','Units','normalized',...
           'Position',[.64 .03 .05 .05],...
           'BackgroundColor',[0 0 .5],...
           'FontSize',12,'Fontname','VNI-Times',...
           'ForegroundColor','white','String','cm',...
           'HorizontalAlignment','center');
  uicontrol('Style','Pushbutton','Units','normalized',...
           'Position',[.87 .03 .1 .05],...
           'FontSize',12,'Fontname','VNI-Times',...
           'Callback','minhhoaxy(''done'')','String','Thoaùt');
       
  min_y=-10;
  max_y=10;
  y=0;
  uicontrol('Style','text','Units','normalized',...
           'Position',[.03 .1 .1 .05],...
           'BackgroundColor',[0 0.5 .5],...
           'FontSize',12,'Fontname','VNI-Times',...
           'ForegroundColor','white','String','Vò trí y:',...
           'HorizontalAlignment','center');
  uicontrol('Style','text','Units','normalized',...
           'Position',[.15 .1 .05 .05],...
           'BackgroundColor',[0 0 .5],...
           'FontSize',12,'Fontname','VNI-Times',...
           'HorizontalAlignment','center',...
           'ForegroundColor','white','String',num2str(min_y));
  uicontrol('Style','text','Units','normalized',...
           'Position',[.45 .1 .05 .05],...
           'BackgroundColor',[0 0 .5],...
           'FontSize',12,'Fontname','VNI-Times',...
           'HorizontalAlignment','center',...
           'ForegroundColor','white','String',num2str(max_y));
  uicontrol('Style','text','Units','normalized',...
           'Position',[.64 .1 .05 .05],...
           'BackgroundColor',[0 0 .5],...
           'FontSize',12,'Fontname','VNI-Times',...
           'ForegroundColor','white','String','cm',...
           'HorizontalAlignment','center');
  y1=uicontrol('Style','slider','Units','normalized',...
           'Position',[.2 .1 .25 .05],...
           'SliderStep',[5.0000e-004 5.0000e-003],...
           'Value',y,'Max',max_y,'Min',min_y,...
           'Callback','minhhoaxy(''sety'',1);minhhoaxy(''redraw'');');
  y2=uicontrol('Style','edit','Units','normalized',...
           'Position',[.55 .1 .09 .05],...
           'FontSize',10','Fontname','VNI-Times',...
           'String',num2str(y),...
           'Callback','minhhoaxy(''sety'',2);minhhoaxy(''redraw'')');
  
       
  dt=plot(x,y,'r.','EraseMode','xor','Markersize',50);
  axis([-10 10 -10 10]);
  grid;
  DATA=[x;min_x;max_x;x1;x2;dt;y;min_y;max_y;y1;y2];
  
  elseif strcmp(action,'redraw'),
      x=DATA(1);
      dt=DATA(6);
      set(DATA(5),'string',num2str(x));    
      set(DATA(4),'value',x);
      y=DATA(7);
      set(DATA(11),'string',num2str(y));    
      set(DATA(10),'value',y);
  
     
      set(dt,'XData',x);
      set(dt,'YDATA',y);
      drawnow;
  
  
  
  elseif strcmp(action,'setx'),
      if (in1==1),
         DATA(1)=get(DATA(4),'value');   
      else
         min_x=DATA(2);     
         max_x=DATA(3); 
         x=str2double(get(DATA(5),'string'));
         if (x&gt;max_x),
             x=max_x;
         end;
         if (x&lt;min_x),
             x=min_x;
         end;
         DATA(1)=x;
      end
      
  elseif strcmp(action,'sety'),
      if (in1==1),
         DATA(7)=get(DATA(10),'value');   
      else
         min_y=DATA(8);     
         max_y=DATA(9); 
         y=str2double(get(DATA(11),'string'));
         if (y&gt;max_y),
             y=max_y;
         end;
         if (y&lt;min_y),
             y=min_y;
         end;
         DATA(7)=y;
      end    
   
  elseif strcmp(action,'done'),
      clf reset;
      clear global DATA
      close;
  end</code></pre>
  </div>
  </div>
  </p>