📄 helical.m
字号:
function varargout = Helical(varargin)
% Helical M-file for Helical.fig
% Helical, by itself, creates a new Helical or raises the existing
% singleton*.
%
% H = Helical returns the handle to a new Helical or the handle to
% the existing singleton*.
%
% Helical('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in Helical.M with the given input arguments.
%
% Helical('Property','Value',...) creates a new Helical or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before Helical_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to Helical_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE'Parameter6Units 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 Helical
% Last Modified by GUIDE v2.5 06-Oct-2005 14:49:51
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Helical_OpeningFcn, ...
'gui_OutputFcn', @Helical_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 Helical is made visible.
function Helical_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 Helical (see VARARGIN)
% Choose default command line output for Helical
handles.output = hObject;
if strcmp(get(hObject,'Visible'),'off')
% Set the Interval to zero
set(handles.Interval,'Value',0.5);
set(handles.Interval,'String','0.5');
% Sets frequency to default 300 MHz
set(handles.Frequency,'Value',300);
set(handles.InterpSelect,'Value',1);
% Set the dropdown menu for Antenna Selection, and position of current
% antenna
SetAntennas(handles,2);
set(handles.InterpSelect,'Visible','Off')
set(handles.InterpTxt,'Visible','Off')
set(handles.InterpHelp,'Visible','Off')
% Plot Graphs, and set Parameter Names
HelicalSetup(hObject,handles);
% Determine if there are multiple traces
MultipleTrace(hObject,handles);
% Sets the crosshairs at default value
[X,Y] = SetUp(handles,[6 6 (2.5*10.033 - 21.9*log10(6) + 21)]);
% Set Legend on left hand panel
HelicalSetParameters(handles,X,Y);
% Draw the Antenna
HelicalDraw(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});
set(handles.Wizard,'CurrentAxes',handles.axes1)
% Update handles structure
guidata(hObject, handles);
end
% UIWAIT makes Helical wait for user response (see UIRESUME)
% uiwait(handles.Wizard);
function [X Y] = SetUp(handles,Point)
NumberGraphs = numel(findobj(handles.Wizard,'Type','axes'))-1;
X = zeros(1,NumberGraphs);
Y = zeros(1,NumberGraphs);
Property = {'setx','setx','sety'};
for i=1:NumberGraphs
s = strcat('handles.axes',num2str(i));
set(gcf,'CurrentAxes',eval(s));
% Set Default values
[X(i),Y(i)] = crosshair(Property{i},Point(i));
% 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})
HelicalInteractive(FigHandle,'move');
set(gcbf,'WindowButtonMotionFcn',{@WindowButtonMotionFcn,gcbf})
function WindowButtonMotionFcn(src,eventdata,FigHandle)
HelicalInteractive(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
HelicalInteractive(gcbf, action);
drawnow
else
return;
end
% --- 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 = Helical_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);
HelicalInteractive(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
% P = get(hObject,'Value');
% P = sprintf('%2.0f',P);
% set(hObject,'String',P);
set(gcf,'CurrentAxes',handles.axes1);
Val = str2double(get(hObject,'String'));
if ~isnan(Val)
[X,Y] = crosshair('sety',Val);
HelicalInteractive(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');
% P = sprintf('%2.2f',P);
% set(hObject,'String',P);
set(gcf,'CurrentAxes',handles.axes2);
Val = str2double(get(hObject,'String'));
if ~isnan(Val)
[X,Y] = crosshair('sety',Val);
HelicalInteractive(gcbf,'draw')
else
P = get(hObject,'Value');
set(hObject,'String',num2str(P));
end
% --- 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));
% set(gcf,'CurrentAxes',handles.axes3);
% Val = str2double(get(hObject,'String'));
% if ~isnan(Val)
% [X,Y] = crosshair('sety',Val);
% HelicalInteractive(gcbf,'draw')
% else
% P = get(hObject,'Value');
% P = sprintf('%2.2f',P);
% set(hObject,'String',P)
% end
% --- 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));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -