function varargout = startstop(varargin)
% STARTSTOP MATLAB code for startstop.fig
%      STARTSTOP, by itself, creates a new STARTSTOP or raises the existing
%      singleton*.
%
%      H = STARTSTOP returns the handle to a new STARTSTOP or the handle to
%      the existing singleton*.
%
%      STARTSTOP('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in STARTSTOP.M with the given input arguments.
%
%      STARTSTOP('Property','Value',...) creates a new STARTSTOP or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before startstop_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to startstop_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help startstop

% Last Modified by GUIDE v2.5 09-Oct-2017 12:40:23

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @startstop_OpeningFcn, ...
                   'gui_OutputFcn',  @startstop_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before startstop is made visible.
function startstop_OpeningFcn(hObject, eventdata, handles, varargin)

handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% --- Outputs from this function are returned to the command line.
function varargout = startstop_OutputFcn(hObject, eventdata, handles) 

varargout{1} = handles.output;

% --- Executes on button press in start.
function start_Callback(hObject, eventdata, handles)
xx=1:1000; yy=1000:2000; zz=2000:3000;
 for i=1:999
 a=get(handles.stop,'Value');
if a==1
    break
    cla reset
    delete(h)
    cla reset
end  
     h(i)=line([zz(i) zz(i+1)],[xx(i) xx(i+1)],[yy(i) yy(i+1)] ,'LineWidth',3);
        drawnow
 end
  guidata(hObject, handles);

% --- Executes on button press in stop.
function stop_Callback(hObject, eventdata, handles)

cla reset
guidata(hObject, handles);