function varargout = gui_soln(varargin)
% GUI_SOLN M-file for gui_soln.fig
%      GUI_SOLN, by itself, creates a new GUI_SOLN or raises the existing
%      singleton*.
%
%      H = GUI_SOLN returns the handle to a new GUI_SOLN or the handle to
%      the existing singleton*.
%
%      GUI_SOLN('Property','Value',...) creates a new GUI_SOLN using the
%      given property value pairs. Unrecognized properties are passed via
%      varargin to gui_soln_OpeningFcn.  This calling syntax produces a
%      warning when there is an existing singleton*.
%
%      GUI_SOLN('CALLBACK') and GUI_SOLN('CALLBACK',hObject,...) call the
%      local function named CALLBACK in GUI_SOLN.M with the given input
%      arguments.
%
%      *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 gui_soln

% Last Modified by GUIDE v2.5 03-Jun-2002 14:19:14

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @gui_soln_OpeningFcn, ...
                   'gui_OutputFcn',  @gui_soln_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin & isstr(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 gui_soln is made visible.
function gui_soln_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   unrecognized PropertyName/PropertyValue pairs from the
%            command line (see VARARGIN)

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

% Update handles structure
guidata(hObject, handles);

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


% --- Outputs from this function are returned to the command line.
function varargout = gui_soln_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 drawPeaks.
function drawPeaks_Callback(hObject, eventdata, handles)
% hObject    handle to drawPeaks (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
surf(peaks(30),'FaceColor','blue');

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

hsurf = findobj(gcf,'Type','Surface');    % Get handle to surface
newColor = rand(1,3);                     % Set random hue values
set(hsurf,'FaceColor',newColor);          % Set face color of surface
% --- Executes during object creation, after setting all properties.
function slider1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to slider1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: slider controls usually have a light gray background, change
%       'usewhitebg' to 0 to use default.  See ISPC and COMPUTER.
usewhitebg = 1;
if usewhitebg
    set(hObject,'BackgroundColor',[.9 .9 .9]);
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end


% --- Executes on slider movement.
function slider1_Callback(hObject, eventdata, handles)
% hObject    handle to slider1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider


hsurf = findobj(gcf,'Type','Surface');    % Get handle to surface
currentColor = get(hsurf,'EdgeColor');    % Get the current edge color
newRed = get(hObject,'Value');            % Get new color from slider

currentColor= rand(1,3);  % Assign value to first element of HSV

set(hsurf,'EdgeColor',currentColor);      % Set edge color of surface



% --------------------------------------------------------------------
function Untitled_1_Callback(hObject, eventdata, handles)
% hObject    handle to Untitled_1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


