function varargout = PlaneWaveGUI(varargin)
%
% function varargout = PLANEWAVEGUI(varargin)
%
% The function PLANEWAVEGUI creates the Graphical User Interface for the
% TE/TM wave propagation through multilayered structures. See the file
% 'Help.html' or click on the button 'Help' of the GUI for its use.
%
% Copyright: Lorenzo Luini, DEI-Department of Electronics and Information,
% Politecnico di Milano, Milano, Italy;
% email: luini@elet.polimi.it
%
% Release: version 1.0, last update: 05-Oct-2007 10:00:00
%
% Remarks: the GUI has been created using GUIDE. It requires Matlab release
% R2007a to run properly.
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @PlaneWaveGUI_OpeningFcn, ...
'gui_OutputFcn', @PlaneWaveGUI_OutputFcn, ...
'gui_LayoutFcn', @PlaneWaveGUI_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 PlaneWaveGUI is made visible.
function PlaneWaveGUI_OpeningFcn(hObject, eventdata, handles, varargin)
% Choose default command line output for PlaneWaveGUI
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% Run the script with default values after initialization
% Retrieve input data from the GUI
teta=get(handles.edit5);
teta=str2num(teta.String);
freq=get(handles.edit1);
freq=str2num(freq.String);
er=get(handles.edit2);
er=str2num(er.String);
mr=get(handles.edit3);
mr=str2num(mr.String);
sigma=get(handles.edit4);
sigma=str2num(sigma.String);
Zlay=get(handles.edit6);
Zlay=str2num(Zlay.String);
Zlay=[0 Zlay];
fH(1)=handles.axes1;
fH(2)=handles.axes4;
fH(3)=handles.axes5;
fH(4)=handles.axes6;
A0=get(handles.edit7);
A0=str2num(A0.String);
anim=get(handles.radiobutton1);
anim=anim.Value;
RealorAbs=get(handles.popupmenu1,'Value');
TETM=get(handles.popupmenu2,'Value');
zval=get(handles.edit9);
zval=str2num(zval.String);
nsam=get(handles.edit10);
nsam=str2num(nsam.String);
% Define an alias of the function
PlaneW=@PlaneWave_MultLayer;
% Check if input data are correct
ResInp=CheckInputs(teta,freq,er,mr,sigma,Zlay,3,0,fH,A0,zval,zval,nsam,anim,RealorAbs,TETM,0);
% If check is passed, run the code
if ResInp==1
PlaneWave_MultLayer(teta,freq,er,mr,sigma,Zlay,3,0,fH,A0,zval,zval,nsam,anim,RealorAbs,TETM,0)
end
% --- Outputs from this function are returned to the command line.
function varargout = PlaneWaveGUI_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 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
function edit4_Callback(hObject, eventdata, handles)
% hObject handle to edit4 (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 edit4 as text
% str2double(get(hObject,'String')) returns contents of edit4 as a double
% --- Executes during object creation, after setting all properties.
function edit4_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit4 (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 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')
评论0