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

📄 viewgraphs.m

📁 天线设计方面的资料
💻 M
字号:
function varargout = ViewGraphs(varargin)
% VIEWGRAPHS M-file for ViewGraphs.fig
%      VIEWGRAPHS, by itself, creates a new VIEWGRAPHS or raises the existing
%      singleton*.
%
%      H = VIEWGRAPHS returns the handle to a new VIEWGRAPHS or the handle to
%      the existing singleton*.
%
%      VIEWGRAPHS('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in VIEWGRAPHS.M with the given input arguments.
%
%      VIEWGRAPHS('Property','Value',...) creates a new VIEWGRAPHS or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before ViewGraphs_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to ViewGraphs_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 ViewGraphs

% Last Modified by GUIDE v2.5 06-Oct-2005 02:02:14

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

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

% UIWAIT makes ViewGraphs wait for user response (see UIRESUME)
% uiwait(handles.figure1);
Handles = varargin{1};
set(hObject,'UserData',Handles);
Graphs = findobj(Handles.Wizard,'Type','axes');
Graphs(find(Graphs==Handles.antenna))=[];
nAxes = size(Graphs,1);
AxHand = {'Handles.axes1','Handles.axes2','Handles.axes3',...
    'Handles.axes4','Handles.axes5','Handles.axes6'};
Checkbox = {'handles.checkbox1','handles.checkbox2',...
    'handles.checkbox3','handles.checkbox4','handles.checkbox5',...
    'handles.checkbox6'};
AxHand = AxHand(1:nAxes); 
for i=1:nAxes
    Graphs(i) = eval(AxHand{i});
    x = Strip(get(get(Graphs(i),'xlabel'),'string'));
    if iscell(x)
        tmp ='';
        for i=1:size(x,1)
            tmp = strcat(tmp,x{i});
        end
        x = tmp;
    end
    y = Strip(get(get(Graphs(i),'ylabel'),'string'));
    if iscell(y)
        tmp ='';
        for i=1:size(y,1)
            tmp = strcat(tmp,y{i});
        end
        y = tmp;
    end
    vis = get(Graphs(i),'Visible');
    if strcmp(vis,'on')
        status = 1;
    else 
        status = 0;
    end
    set(eval(Checkbox{i}),'string',strcat(x,' vs. ',y),...
        'Value',status);
end
for i=nAxes+1:6
    set(eval(Checkbox{i}),'Value',0,'Visible','off')
end
% Update handles structure
set(hObject,'WindowStyle','modal')
guidata(hObject, handles);

% Remove LaTeX commands
function txt = Strip(txt)
if iscell(txt)
    for i=1:size(txt,1)
        txt{i} = Strip(txt{i});
    end
else
    index = strfind(txt,'\bf');
    if ~isempty(index) 
        txt((index(1):(index(1)+2)))=[]; 
        if size(index,2)>1
            txt((index(2)-3:(index(2)-1)))=[];
        end
    end
    index = strfind(txt,'\rm');    
    if ~isempty(index) txt(index:index+2)=[]; end
    index = strfind(txt,'({m})');
    if ~isempty(index) txt(index:index+4)=[]; end
    index = strfind(txt,'(\lambda)');    
    if ~isempty(index) txt(index:index+8)=[]; end
    index = strfind(txt,'{');    
    if ~isempty(index) txt(index)=[]; end
    index = strfind(txt,'}');    
    if ~isempty(index) txt(index)=[]; end
end
% --- Outputs from this function are returned to the command line.
function varargout = ViewGraphs_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 checkbox1.
function checkbox1_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox1 (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 checkbox1
 if any([get(handles.checkbox1,'Value')  get(handles.checkbox2,'Value')  ...
         get(handles.checkbox3,'Value')  get(handles.checkbox4,'Value')  ...
         get(handles.checkbox5,'Value')  get(handles.checkbox6,'Value')])
    if get(hObject,'Value')
        vis = 'on';
    else
        vis = 'off';
    end
    Handles = get(gcbf,'UserData');
    axis(Handles.axes1,vis);
    sibs = get(Handles.axes1,'Children');
    set(sibs,'Visible',vis);
 else
    set(hObject,'Value',~get(hObject,'Value'))
 end

% --- Executes on button press in checkbox2.
function checkbox2_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox2 (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 checkbox2
 if any([get(handles.checkbox1,'Value')  get(handles.checkbox2,'Value')  ...
         get(handles.checkbox3,'Value')  get(handles.checkbox4,'Value')  ...
         get(handles.checkbox5,'Value')  get(handles.checkbox6,'Value')])
    if get(hObject,'Value')
        vis = 'on';
    else
        vis = 'off';
    end
    Handles = get(gcbf,'UserData');
    axis(Handles.axes2,vis);
    sibs = get(Handles.axes2,'Children');
    set(sibs,'Visible',vis);
 else
    set(hObject,'Value',~get(hObject,'Value'))
 end

% --- Executes on button press in checkbox3.
function checkbox3_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox3 (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 checkbox3
 if any([get(handles.checkbox1,'Value')  get(handles.checkbox2,'Value')  ...
         get(handles.checkbox3,'Value')  get(handles.checkbox4,'Value')  ...
         get(handles.checkbox5,'Value')  get(handles.checkbox6,'Value')])
    if get(hObject,'Value')
        vis = 'on';
    else
        vis = 'off';
    end
    Handles = get(gcbf,'UserData');
    axis(Handles.axes3,vis);
    sibs = get(Handles.axes3,'Children');
    set(sibs,'Visible',vis);
 else
    set(hObject,'Value',~get(hObject,'Value'))
 end

% --- Executes on button press in checkbox4.
function checkbox4_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox4 (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 checkbox4
 if any([get(handles.checkbox1,'Value')  get(handles.checkbox2,'Value')  ...
         get(handles.checkbox3,'Value')  get(handles.checkbox4,'Value')  ...
         get(handles.checkbox5,'Value')  get(handles.checkbox6,'Value')])
    if get(hObject,'Value')
        vis = 'on';
    else
        vis = 'off';
    end
    Handles = get(gcbf,'UserData');
    axis(Handles.axes4,vis);
    sibs = get(Handles.axes4,'Children');
    set(sibs,'Visible',vis);
 else
    set(hObject,'Value',~get(hObject,'Value'))
 end

% --- Executes on button press in checkbox5.
function checkbox5_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox5 (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 checkbox5
 if any([get(handles.checkbox1,'Value')  get(handles.checkbox2,'Value')  ...
         get(handles.checkbox3,'Value')  get(handles.checkbox4,'Value')  ...
         get(handles.checkbox5,'Value')  get(handles.checkbox6,'Value')])
    if get(hObject,'Value')
        vis = 'on';
    else
        vis = 'off';
    end
    Handles = get(gcbf,'UserData');
    axis(Handles.axes5,vis);
    sibs = get(Handles.axes5,'Children');
    set(sibs,'Visible',vis);
 else
     set(hObject,'Value',~get(hObject,'Value'))
 end

% --- Executes on button press in checkbox6.
function checkbox6_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox6 (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 checkbox6
 if any([get(handles.checkbox1,'Value')  get(handles.checkbox2,'Value')  ...
         get(handles.checkbox3,'Value')  get(handles.checkbox4,'Value')  ...
         get(handles.checkbox5,'Value')  get(handles.checkbox6,'Value')])
    if get(hObject,'Value')
        vis = 'on';
    else
        vis = 'off';
    end
    Handles = get(gcbf,'UserData');
    axis(Handles.axes6,vis);
    sibs = get(Handles.axes6,'Children');
    set(sibs,'Visible',vis);
 else
    set(hObject,'Value',~get(hObject,'Value'))
 end

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

⌨️ 快捷键说明

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