⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gui_show_mode.m

📁 利用电磁场的源激发方法来计算光子晶体波导例如光子晶体光纤
💻 M
字号:
function varargout = gui_show_mode(varargin)
% GUI_SHOW_MODE M-file for gui_show_mode.fig
%      GUI_SHOW_MODE, by itself, creates a new GUI_SHOW_MODE or raises the existing
%      singleton*.
%
%      H = GUI_SHOW_MODE returns the handle to a new GUI_SHOW_MODE or the handle to
%      the existing singleton*.
%
%      GUI_SHOW_MODE('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in GUI_SHOW_MODE.M with the given input arguments.
%
%      GUI_SHOW_MODE('Property','Value',...) creates a new GUI_SHOW_MODE or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before gui_show_mode_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to gui_show_mode_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 gui_show_mode

% Last Modified by GUIDE v2.5 29-May-2006 19:03:23

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

% Choose default command line output for gui_show_mode
handles.mF = varargin{2};
handles.oGd = varargin{4};
handles.vX = varargin{6};
handles.vY = varargin{8};
axes(handles.uiAxes);
ShowMode(abs(handles.mF), handles.oGd, handles.vX, handles.vY); 
set(handles.uiAbs, 'value', 1);
set(handles.uiPh, 'value', 0);
set(handles.uiIm, 'value', 0);
set(handles.uiRe, 'value', 0);
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

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


% --- Outputs from this function are returned to the command line.
function varargout = gui_show_mode_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 uiAbs.
function uiAbs_Callback(hObject, eventdata, handles)
% hObject    handle to uiAbs (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 uiAbs
set(hObject, 'Value', 1);
set(handles.uiIm, 'value', 0);
set(handles.uiPh, 'value', 0);
set(handles.uiRe, 'value', 0);
ShowMode(abs(handles.mF), handles.oGd, handles.vX, handles.vY);  
guidata(hObject, handles);


% --- Executes on button press in uiPh.
function uiPh_Callback(hObject, eventdata, handles)
% hObject    handle to uiPh (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 uiPh
set(hObject, 'Value', 1);
set(handles.uiAbs, 'value', 0);
set(handles.uiIm, 'value', 0);
set(handles.uiRe, 'value', 0);
ShowMode(angle(handles.mF), handles.oGd, handles.vX, handles.vY);  
guidata(hObject, handles);


% --- Executes on button press in uiRe.
function uiRe_Callback(hObject, eventdata, handles)
% hObject    handle to uiRe (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 uiRe
set(hObject, 'Value', 1);
set(handles.uiAbs, 'value', 0);
set(handles.uiPh, 'value', 0);
set(handles.uiIm, 'value', 0);
ShowMode(real(handles.mF), handles.oGd, handles.vX, handles.vY); 
guidata(hObject, handles);


% --- Executes on button press in uiIm.
function uiIm_Callback(hObject, eventdata, handles)
% hObject    handle to uiIm (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 uiIm
set(hObject, 'Value', 1);
set(handles.uiAbs, 'value', 0);
set(handles.uiPh, 'value', 0);
set(handles.uiRe, 'value', 0);
ShowMode(imag(handles.mF), handles.oGd, handles.vX, handles.vY);  
guidata(hObject, handles);


% --- Executes on button press in uiToBase.
function uiToBase_Callback(hObject, eventdata, handles)
% hObject    handle to uiToBase (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
assignin('base', 'mField', handles.mF)
disp('Results exported to variable: mField')

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -