function varargout = Radio_button_demo(varargin)
% RADIO_BUTTON_DEMO M-file for Radio_button_demo.fig
%      RADIO_BUTTON_DEMO, by itself, creates a new RADIO_BUTTON_DEMO or raises the existing
%      singleton*.
%
%      H = RADIO_BUTTON_DEMO returns the handle to a new RADIO_BUTTON_DEMO or the handle to
%      the existing singleton*.
%
%      RADIO_BUTTON_DEMO('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in RADIO_BUTTON_DEMO.M with the given input arguments.
%
%      RADIO_BUTTON_DEMO('Property','Value',...) creates a new RADIO_BUTTON_DEMO or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before Radio_button_demo_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to Radio_button_demo_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

% Copyright 2002-2003 The MathWorks, Inc.

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

% Last Modified by GUIDE v2.5 03-Nov-2005 20:26:24

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @Radio_button_demo_OpeningFcn, ...
                   'gui_OutputFcn',  @Radio_button_demo_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 Radio_button_demo is made visible.
function Radio_button_demo_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to Radio_button_demo (see VARARGIN)

% Choose default command line output for Radio_button_demo
handles.output = hObject;

% Plot the line
x = -10:0.35:10;
y = x.*sin(x);
handles.Line = plot(handles.Plot_axes, x, y);

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes Radio_button_demo wait for user response (see UIRESUME)
% uiwait(handles.figure1);



% --- Outputs from this function are returned to the command line.
function varargout = Radio_button_demo_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;


% --- Executes on button press in No_marker_button.
function No_marker_button_Callback(hObject, eventdata, handles)
% hObject    handle to No_marker_button (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of No_marker_button

set(handles.No_marker_button, 'Value', 1.0);
set(handles.Plus_marker,      'Value', 0.0);
set(handles.Diamond_marker,   'Value', 0.0);

set(handles.Line, 'Marker', 'none');

% --- Executes on button press in Plus_marker.
function Plus_marker_Callback(hObject, eventdata, handles)
% hObject    handle to Plus_marker (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of Plus_marker

set(handles.No_marker_button, 'Value', 0.0);
set(handles.Plus_marker,      'Value', 1.0);
set(handles.Diamond_marker,   'Value', 0.0);

set(handles.Line, 'Marker', '+');

% --- Executes on button press in Diamond_marker.
function Diamond_marker_Callback(hObject, eventdata, handles)
% hObject    handle to Diamond_marker (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of Diamond_marker

set(handles.No_marker_button, 'Value', 0.0);
set(handles.Plus_marker,      'Value', 0.0);
set(handles.Diamond_marker,   'Value', 1.0);

set(handles.Line, 'Marker', 'diamond');

