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

% Last Modified by GUIDE v2.5 25-Jan-2012 22:17:34

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @RotationGUI_OpeningFcn, ...
                   'gui_OutputFcn',  @RotationGUI_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 RotationGUI is made visible.
function RotationGUI_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 RotationGUI (see VARARGIN)

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

handles.pRot11 =uibutton('Style','text','Unit','characters',...
    'Position',[ 1.0000    11.5385   30.0000    2.0000 ],...
    'String','','BackgroundColor' , ...
    [0.839216 0.909804 0.85098],'Fontsize',10);

handles.pRot12 =uibutton('Style','text','Unit','characters',...
    'Position',[ 41.0000    11.5385   30.0000    2.0000 ],...
    'String','','BackgroundColor' , ...
    [0.839216 0.909804 0.85098],'Fontsize',10);

handles.pRot13 =uibutton('Style','text','Unit','characters',...
    'Position',[ 82.0000    11.5385   30.0000    2.0000],...
    'String','','BackgroundColor' , ...
    [0.839216 0.909804 0.85098],'Fontsize',10);

handles.pRot21 =uibutton('Style','text','Unit','characters',...
    'Position',[ 1.0000    8.7692   30.0000    2.0000 ],...
    'String','','BackgroundColor' , ...
    [0.839216 0.909804 0.85098],'Fontsize',10);

handles.pRot22 =uibutton('Style','text','Unit','characters',...
    'Position',[ 41.0000    8.7692   30.0000    2.0000 ],...
    'String','','BackgroundColor' , ...
    [0.839216 0.909804 0.85098],'Fontsize',10);

handles.pRot23 =uibutton('Style','text','Unit','characters',...
    'Position',[  82.0000    8.7692   30.0000    2.0000],...
    'String','','BackgroundColor' , ...
    [0.839216 0.909804 0.85098],'Fontsize',10);


handles.pRot31 =uibutton('Style','text','Unit','characters',...
    'Position',[ 1.0000    6.0000   30.0000    2.0000 ],...
    'String','','BackgroundColor' , ...
    [0.839216 0.909804 0.85098],'Fontsize',10);

handles.pRot32 =uibutton('Style','text','Unit','characters',...
    'Position',[ 41.0000    6.0000   30.0000    2.0000 ],...
    'String','','BackgroundColor' , ...
    [0.839216 0.909804 0.85098],'Fontsize',10);

handles.pRot33 =uibutton('Style','text','Unit','characters',...
    'Position',[ 82.0000    6.0000   30.0000    2.0000],...
    'String','','BackgroundColor' , ...
    [0.839216 0.909804 0.85098],'Fontsize',10);

set(handles.popRX, 'Value', 1 ) ;
set(handles.popRY, 'Value', 2 ) ;
set(handles.popRZ, 'Value', 3 ) ;

set(handles.popX, 'Value', 1 ) ;
set(handles.popY, 'Value', 2 ) ;
set(handles.popZ, 'Value', 3 ) ;

% Update handles structure
guidata(hObject, handles);

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


% --- Outputs from this function are returned to the command line.
function varargout = RotationGUI_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;


function edit5_Callback(hObject, eventdata, handles)
% hObject    handle to edit5 (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,'String') returns contents of edit5 as text
%        str2double(get(hObject,'String')) returns contents of edit5 as a double


% --- Executes during object creation, after setting all properties.
function edit5_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit5 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function edit6_Callback(hObject, eventdata, handles)
% hObject    handle to edit6 (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,'String') returns contents of edit6 as text
%        str2double(get(hObject,'String')) returns contents of edit6 as a double


% --- Executes during object creation, after setting all properties.
function edit6_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit6 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function edit1_Callback(hObject, eventdata, handles)
% hObject    handle to edit1 (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,'String') returns contents of edit1 as text
%        str2double(get(hObject,'String')) returns contents of edit1 as a double


% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function edit2_Callback(hObject, eventdata, handles)
% hObject    handle to edit2 (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,'String') returns contents of edit2 as text
%        str2double(get(hObject,'String')) returns contents of edit2 as a double


% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function edit3_Callback(hObject, eventdata, handles)
% hObject    handle to edit3 (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,'String') returns contents of edit3 as text
%        str2double(get(hObject,'String')) returns contents of edit3 as a double


% --- Executes during object creation, after setting all properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on selection change in popRX.
function popRX_Callback(hObject, eventdata, handles)
% hObject    handle to popRX (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,'String')) returns popRX contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popRX
% contents = cellstr(get(hObject,'String'))
% value=get(hObject,'Value')
% selected = contents{get(hObject,'Value')}
% setappdata(0,'ROTX',selected)



% --- Executes during object creation, after setting all properties.
function popRX_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popRX (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on selection change in popRY.
function popRY_Callback(hObject, eventdata, handles)
% hObject    handle to popRY (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,'String')) returns popRY contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popRY
% contents = cellstr(get(hObject,'String'))
% value=get(hObject,'Value')
% selected = contents{get(hObject,'Value')}
% setappdata(0,'ROTY',selected)

% --- Executes during object creation, after setting all properties.
function popRY_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popRY (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on selection change in popRZ.
function popRZ_Callback(hObject, eventdata, handles)
% hObject    handle to popRZ (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,'String')) returns popRZ contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popRZ
contents = cellstr(get(hObject,'String'));
value=get(hObject,'Value');
selected = contents{get(hObject,'Value')};
setappdata(0,'ROTZ',selected);

% --- Executes during object creation, after setting all properties.
function popRZ_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popRZ (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

% --- Executes during object creation, after setting all properties.
function popX_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popX (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes during object creation, after setting all properties.
function popY_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popY (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes during object creation, after setting all properties.
function popZ_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popZ (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on selection change in popX.
function popX_Callback(hObject, eventdata, handles)
% hObject    handle to popX (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,'String')) returns popX contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popX


% --- Executes on selection change in popY.
function popY_Callback(hObject, eventdata, handles)
% hObject    handle to popY (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,'String')) returns popY contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popY


% --- Executes on selection change in popZ.
function popZ_Callback(hObject, eventdata, handles)
% hObject    handle to popZ (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,'String')) returns popZ contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popZ



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

set(handles.pb_Save_and_Close, 'Visible', 'on');
set(handles.left_line, 'Visible', 'on');
set(handles.left_line_top, 'Visible', 'on');
set(handles.left_line_bottom, 'Visible', 'on');

set(handles.right_line, 'Visible', 'on');
set(handles.right_line_top, 'Visible', 'on');
set(handles.right_line_bottom, 'Visible', 'on');



set(handles.pb_Save_and_Close, 'Visible', 'on');

contents = cellstr(get(handles.popZ,'String'));
RotZ = contents{get(handles.popZ,'Value')};%%%'gamma'
z = sym( RotZ );


contents = cellstr(get(handles.popY,'String'));
RotY = contents{get(handles.popY,'Value')};%%%'gamma'
y = sym( RotY );


contents = cellstr(get(handles.popX,'String'));
RotX = contents{get(handles.popX,'Value')};%%%'gamma'
x = sym( RotX );

Rotationz = [ cos(z) ,     -sin(z) ,   0  ;...    
              sin(z) ,    cos(z)   ,   0  ;...
                0    ,       0     ,   1      ] ;
    
Rotationy = [ cos(y)      0       sin(y) ;    
                0         1          0      
             -sin(y)      0       cos(y)  ] ;
            
Rotationx = [   1         0         0         ;    
                0       cos(x)    -sin(x)    ;
                0       sin(x)     cos(x)      ]  ; 
   
            
contents = cellstr(get(handles.popRZ,'String'));
zz = contents{get(handles.popRZ,'Value')};%%%'gamma'

contents = cellstr(get(handles.popRY,'String'));
yy = contents{get(handles.popRY,'Value')};%%%'gamma'

contents = cellstr(get(handles.popRX,'String'));
xx = contents{get(handles.popRX,'Value')};%%%'gamma'           

% Rot =    RotationZ  *   RotationY  *  RotationX   

typeRPW = get(handles.checkbox_RollPitchYaw,'Value');
typeEuler = get(handles.checkbox_Euler,'Value');

if ( typeRPW == 1 ) 
% Rot = eval(['Rotation' xx '*' 'Rotation' yy '*' 'Rotation' zz] );
Rot = eval(['Rotation' zz '*' 'Rotation' yy '*' 'Rotation' xx] );
elseif typeEuler == 1 
Rot = eval(['Rotation' xx '*' 'Rotation' yy '*' 'Rotation' zz] );    
% Rot = eval(['Rotation' zz '*' 'Rotation' yy '*' 'Rotation' xx] );
end
    
setappdata(0,'Rotation_Matrix', Rot );


%%%% replace alpha,beta,gamma \alpha, \beta,\gamma
rot = char(Rot(1,1));
rot = strrep(rot, 'alpha', '\alpha');
rot = strrep(rot, 'beta', '\beta');
rot = strrep(rot, 'gamma', '\gamma');
rot = strrep(rot, 'cos', 'c');
rot = strrep(rot, 'sin', 's');
rot = strrep(rot, '(', '');
rot = strrep(rot, ')', '');
rot = strrep(rot, '*', ' ');


set( handles.pRot11 , 'String',rot);

rot = char(Rot(1,2));
rot = strrep(rot, 'alpha', '\alpha');
rot = strrep(rot, 'beta', '\beta');
rot = strrep(rot, 'gamma', '\gamma');
rot = strrep(rot, 'cos', 'c');
rot = strrep(rot, 'sin', 's');
rot = strrep(rot, '(', '');
rot = strrep(rot, ')', '');
rot = strrep(rot, '*', ' ');

set( handles.pRot12 , 'String',rot);

rot = char(Rot(1,3));
rot = strrep(rot, 'alpha', '\alpha');
rot = strrep(rot, 'beta', '\beta');
rot = strrep(rot, 'gamma', '\gamma');
rot = strrep(rot, 'cos', 'c');
rot = strrep(rot, 'sin', 's');
rot = strrep(rot, '(', '');
rot = strrep(rot, ')', '');
rot = strrep(rot, '*', ' ');

set( handles.pRot13 , 'String',rot);

%%%% replace alpha,beta,gamma \alpha, \beta,\gamma
rot = char(Rot(2,1));
rot = strrep(rot, 'alpha', '\alpha');
rot = strrep(rot, 'beta', '\beta');
rot = strrep(rot, 'gamma', '\gamma');
rot = strrep(rot, 'cos', 'c');
rot = strrep(rot, 'sin', 's');
rot = strrep(rot, '(', '');
rot = strrep(rot, ')', '');
rot = strrep(rot, '*', ' ');

set( handles.pRot21 , 'String',rot);

rot = char(Rot(2,2));
rot = strrep(rot, 'alpha', '\alpha');
rot = strrep(rot, 'beta', '\beta');
rot = strrep(rot, 'gamma', '\gamma');
rot = strrep(rot, 'cos', 'c');
rot = strrep(rot, 'sin', 's');
rot = strrep(rot, '(', '');
rot = strrep(rot, ')', '');
rot = strrep(rot, '*', ' ');

set( handles.pRot22 , 'String',rot);


rot = char(Rot(2,3));
rot = strrep(rot, 'alpha', '\alpha');
rot = strrep(rot, 'beta', '\beta');
rot = strrep(rot, 'gamma', '\gamma');
rot = strrep(rot, 'cos', 'c');
rot = strrep(rot, 'sin', 's');
rot = strrep(rot, '(', '');
rot = strrep(rot, ')', '');
rot = strrep(rot, '*', ' ');

set( handles.pRot23 , 'String',rot);

%%%% replace alpha,beta,gamma \alpha, \beta,\gamma
rot = char(Rot(3,1));
rot = strrep(rot, 'alpha', '\alpha');
rot = strrep(rot, 'beta', '\beta');
rot = strrep(rot, 'gamma', '\gamma');
rot = strrep(rot, 'cos', 'c');
rot = strrep(rot, 'sin', 's');
rot = strrep(rot, '(', '');
rot = strrep(rot, ')', '');
rot = strrep(rot, '*', ' ');

set( handles.pRot31 , 'String',rot);

rot = char(Rot(3,2));
rot = strrep(rot, 'alpha', '\alpha');
rot = strrep(rot, 'beta', '\beta');
rot = strrep(rot, 'gamma', '\gamma');
rot = strrep(rot, 'cos', 'c');
rot = strrep(rot, 'sin', 's');
rot = strrep(rot, '(', '');
rot = strrep(rot, ')', '');
rot = strrep(rot, '*', ' ');

set( handles.pRot32 , 'String',rot);


rot = char(Rot(3,3));
rot = strrep(rot, 'alpha', '\alpha');
rot = strrep(rot, 'beta', '\beta');
rot = strrep(rot, 'gamma', '\gamma');
rot = strrep(rot, 'cos', 'c');
rot = strrep(rot, 'sin', 's');
rot = strrep(rot, '(', '');
rot = strrep(rot, ')', '');
rot = strrep(rot, '*', ' ');

set( handles.pRot33 , 'String',rot);









% --- Executes on button press in checkbox_RollPitchYaw.
function checkbox_RollPitchYaw_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox_RollPitchYaw (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 checkbox_RollPitchYaw
RollPitchYaw = get(hObject,'Value');
Euler = get(handles.checkbox_Euler,'Value');
set(handles.checkbox_Euler,'Value',~Euler);


% --- Executes on button press in checkbox_Euler.
function checkbox_Euler_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox_Euler (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 checkbox_Euler

RollPitchYaw = get(handles.checkbox_RollPitchYaw,'Value');
set(handles.checkbox_RollPitchYaw,'Value',~RollPitchYaw);


% --- Executes on selection change in popupmenu7.
function popupmenu7_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu7 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu7 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu7


% --- Executes during object creation, after setting all properties.
function popupmenu7_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu7 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


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