📄 yagipoynting.m
字号:
function varargout = YagiPoynting(varargin)
% YAGIPOYNTING M-file for YagiPoynting.fig
% YAGIPOYNTING, by itself, creates a new YAGIPOYNTING or raises the existing
% singleton*.
%
% H = YAGIPOYNTING returns the handle to a new YAGIPOYNTING or the handle to
% the existing singleton*.
%
% YAGIPOYNTING('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in YAGIPOYNTING.M with the given input arguments.
%
% YAGIPOYNTING('Property','Value',...) creates a new YAGIPOYNTING or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before YagiPoynting_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to YagiPoynting_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 YagiPoynting
% Last Modified by GUIDE v2.5 06-Oct-2005 14:52:03
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @YagiPoynting_OpeningFcn, ...
'gui_OutputFcn', @YagiPoynting_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 YagiPoynting is made visible.
function YagiPoynting_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 YagiPoynting (see VARARGIN)
% Choose default command line output for YagiPoynting
handles.output = hObject;
if strcmp(get(hObject,'Visible'),'off')
% Set the Interval to zero
set(handles.Interval,'Value',0);
set(handles.Interval,'String','0');
% Sets frequency to default 300 MHz
set(handles.Frequency,'Value',300);
% Set the dropdown menu for Antenna Selection, and position of current
% antenna
SetAntennas(handles,3);
% Plot Graphs, and set Parameter Names
YagiPoyntingSetup(hObject,handles);
% Determine if there are multiple traces
MultipleTrace(hObject,handles);
% Sets the crosshairs at default value
[X,Y] = SetUp(handles,pi);
% Set Legend on left hand panel
YagiPoyntingSetParameters(handles,X,Y);
% Draw the Antenna
YagiPoyntingDraw(handles)
% Prevent the Antenna axes from becoming the active object when clicked
set(handles.antenna,'HitTest','Off')
% Prevent the Antenna graph from becoming the active object when clicked
set(get(handles.antenna,'Children'),'HitTest','Off')
% Set Action for keypresses
set(gcf,'KeyPressFcn',{@KeyPressFcn,gcbf});
% Update handles structure
guidata(hObject, handles);
end
% UIWAIT makes YagiPoynting wait for user response (see UIRESUME)
% uiwait(handles.figure1);
function [X Y] = SetUp(handles,Point)
NumberGraphs = numel(findobj(handles.Wizard,'Type','axes'))-1;
X = zeros(1,NumberGraphs);
Y = zeros(1,NumberGraphs);
for i=1:NumberGraphs
s = strcat('handles.axes',num2str(i));
set(gcf,'CurrentAxes',eval(s));
% Set Default values
[X(i),Y(i)] = crosshair('setx',Point);
% Set the callback for mouse click on each axes:
set(eval(s),'ButtonDownFcn',{@ButtonDownFcn,eval(s),handles.Wizard});
% Prevents the line data from becoming the active object when
% clicked:
set((get(gca,'Children')),'HitTest','Off');
end
function ButtonDownFcn(src,eventdata,Ax,FigHandle)
set(FigHandle,'CurrentAxes',Ax)
set(FigHandle,'BusyAction','queue')
set(FigHandle,'WindowButtonUpFcn',{@WindowButtonUpFcn,FigHandle})
Interactive(FigHandle,'move');
set(gcbf,'WindowButtonMotionFcn',{@WindowButtonMotionFcn,gcbf})
function WindowButtonMotionFcn(src,eventdata,FigHandle)
Interactive(FigHandle,'move');
function WindowButtonUpFcn(src,eventdata,FigHandle)
set(FigHandle,'WindowButtonMotionFcn','');
set(FigHandle,'WindowButtonUpFcn','');
set(FigHandle,'BusyAction','cancel')
function KeyPressFcn(varargin)
set(gcbf,'WindowButtonMotionFcn',' ');
CC = get(gcbf,'CurrentCharacter');
cc = double(CC);
if cc,
switch cc,
case 28, action = 'prevx'; % left
case 29, action = 'nextx'; % right
otherwise,
return;
end
Interactive(gcbf, action);
drawnow
else
return;
end
% --- Executes during object creation, after setting all properties.
function Wizard_CreateFcn(hObject, eventdata, handles)
% hObject handle to Wizard (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% --- Executes during object deletion, before destroying properties.
function Wizard_DeleteFcn(hObject, eventdata, handles)
% hObject handle to Wizard (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
FullScreenEdit = findobj('Tag','FullScreenEdit');
if ~isempty(FullScreenEdit)
delete(FullScreenEdit)
end
% --- Outputs from this function are returned to the command line.
function varargout = YagiPoynting_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 Parameter1_Callback(hObject, eventdata, handles)
% hObject handle to Parameter1 (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 Parameter1 as text
% str2double(get(hObject,'String')) returns contents of Parameter1 as a double
set(gcf,'CurrentAxes',handles.axes1);
Val = str2double(get(hObject,'String'));
if ~isnan(Val)
[X,Y] = crosshair('setx',Val);
Interactive(gcbf,'draw')
else
P = get(hObject,'Value');
set(hObject,'String',num2str(P))
end
% --- Executes during object creation, after setting all properties.
function Parameter1_CreateFcn(hObject, eventdata, handles)
% hObject handle to Parameter1 (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
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
function Parameter2_Callback(hObject, eventdata, handles)
% hObject handle to Parameter2 (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 Parameter2 as text
% str2double(get(hObject,'String')) returns contents of Parameter2 as a double
%Edditing of values is prohibited
set(gcf,'CurrentAxes',handles.axes1);
Val = str2double(get(hObject,'String'));
if ~isnan(Val)
[X,Y] = crosshair('sety',Val);
Interactive(gcbf,'draw')
else
P = get(hObject,'Value');
set(hObject,'String',num2str(P))
end
% --- Executes during object creation, after setting all properties.
function Parameter2_CreateFcn(hObject, eventdata, handles)
% hObject handle to Parameter2 (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
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
function Parameter3_Callback(hObject, eventdata, handles)
% hObject handle to Parameter3 (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 Parameter3 as text
% str2double(get(hObject,'String')) returns contents of Parameter3 as a double
%Edditing of values is prohibited
P = get(hObject,'Value');
set(hObject,'String',num2str(P));
% --- Executes during object creation, after setting all properties.
function Parameter3_CreateFcn(hObject, eventdata, handles)
% hObject handle to Parameter3 (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
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
function Parameter4_Callback(hObject, eventdata, handles)
% hObject handle to Parameter4 (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 Parameter4 as text
% str2double(get(hObject,'String')) returns contents of Parameter4 as a double
%Edditing of values is prohibited
P = get(hObject,'Value');
set(hObject,'String',num2str(P));
% --- Executes during object creation, after setting all properties.
function Parameter4_CreateFcn(hObject, eventdata, handles)
% hObject handle to Parameter4 (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
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
function Parameter5_Callback(hObject, eventdata, handles)
% hObject handle to Parameter5 (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 Parameter5 as text
% str2double(get(hObject,'String')) returns contents of Parameter5 as a double
%Edditing of values is prohibited
P = get(hObject,'Value');
set(hObject,'String',num2str(P));
% --- Executes during object creation, after setting all properties.
function Parameter5_CreateFcn(hObject, eventdata, handles)
% hObject handle to Parameter5 (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
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
function Parameter6_Callback(hObject, eventdata, handles)
% hObject handle to Parameter6 (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 Parameter6 as text
% str2double(get(hObject,'String')) returns contents of Parameter6 as a double
%Edditing of values is prohibited
P = get(hObject,'Value');
set(hObject,'String',num2str(P));
% --- Executes during object creation, after setting all properties.
function Parameter6_CreateFcn(hObject, eventdata, handles)
% hObject handle to Parameter6 (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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -