📄 yagipoynting.m
字号:
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --- Executes on button press in P1prev.
function P1prev_Callback(hObject, eventdata, handles)
% hObject handle to P1prev (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(gcf,'CurrentAxes',handles.axes1)
Interactive(gcf,'prevx')
% --- Executes on button press in P2prev.
function P2prev_Callback(hObject, eventdata, handles)
% hObject handle to P2prev (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(gcf,'CurrentAxes',handles.axes1)
Interactive(gcf,'prevx')
% --- Executes on button press in P3prev.
function P3prev_Callback(hObject, eventdata, handles)
% hObject handle to P3prev (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(gcf,'CurrentAxes',handles.axes2)
Interactive(gcf,'prevx')
% --- Executes on button press in P4prev.
function P4prev_Callback(hObject, eventdata, handles)
% hObject handle to P4prev (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(gcf,'CurrentAxes',handles.axes3)
Interactive(gcf,'prevx')
% --- Executes on button press in P5prev.
function P5prev_Callback(hObject, eventdata, handles)
% hObject handle to P5prev (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(gcf,'CurrentAxes',handles.axes4)
Interactive(gcf,'prevx')
% --- Executes on button press in P6prev.
function P6prev_Callback(hObject, eventdata, handles)
% hObject handle to P6prev (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(gcf,'CurrentAxes',handles.axes5)
Interactive(gcf,'prevx')
% --- Executes on button press in P1next.
function P1next_Callback(hObject, eventdata, handles)
% hObject handle to P1next (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(gcf,'CurrentAxes',handles.axes1)
Interactive(gcf,'nextx')
% --- Executes on button press in P2next.
function P2next_Callback(hObject, eventdata, handles)
% hObject handle to P2next (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(gcf,'CurrentAxes',handles.axes1)
Interactive(gcf,'nextx')
% --- Executes on button press in P3next.
function P3next_Callback(hObject, eventdata, handles)
% hObject handle to P3next (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(gcf,'CurrentAxes',handles.axes2)
Interactive(gcf,'nextx')
% --- Executes on button press in P4next.
function P4next_Callback(hObject, eventdata, handles)
% hObject handle to P4next (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(gcf,'CurrentAxes',handles.axes3)
Interactive(gcf,'nextx')
% --- Executes on button press in P5next.
function P5next_Callback(hObject, eventdata, handles)
% hObject handle to P5next (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(gcf,'CurrentAxes',handles.axes4)
Interactive(gcf,'nextx')
% --- Executes on button press in P6next.
function P6next_Callback(hObject, eventdata, handles)
% hObject handle to P6next (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(gcf,'CurrentAxes',handles.axes5)
Interactive(gcf,'nextx')
% --- Executes on button press in Simulate.
function Simulate_Callback(hObject, eventdata, handles)
% hObject handle to Simulate (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
try
snecin;
end
if (strfind(lasterr, 'Undefined function or variable ''snecin'''))
Error = errordlg({'It Appears that SuperNEC is not installed.',...
'If SuperNEC is installed please ensure that the paths are set correctly'},'Error');
set(Error,'WindowStyle','modal');
else
AntennaSelect = get(handles.AntennaSelect,'String');
AntennaValue = get(handles.AntennaSelect,'Value');
feval(strcat(AntennaSelect{AntennaValue},'Simulate'),handles);
end
% --- Executes on button press in Summary.
function Summary_Callback(hObject, eventdata, handles)
% hObject handle to Summary (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
Values = zeros(10,1);
Parameters{1} = 'Frequency';
Values(1) = get(handles.Frequency,'Value');
Units{1} = 'MHz';
if get(handles.Units,'Value') == 0
W1 = (300/Values(1));
else
W1 = 1;
end;
% Boomlength
Parameters{2} = get(handles.Parameter1Txt,'String');
Values(2) = get(handles.Parameter1,'Value')*W1;
Units{2}= 'm';
% Elements
Parameters{3} = get(handles.Parameter3Txt,'String');
Values(3) = get(handles.Parameter3,'Value');
Units{3} = '';
% Reflector Length
Parameters{4} = get(handles.Parameter4Txt,'String');
Values(4) = get(handles.Parameter4,'Value')*W1;
Units{4} = 'm';
% Director Length
Parameters{5} = get(handles.Parameter5Txt,'String');
Values(5) = get(handles.Parameter5,'Value')*W1;
Units{5} = 'm';
% Driven Element Length
Parameters{6} = get(handles.Parameter6Txt,'String');
Values(6) = get(handles.Parameter6,'Value')*W1;
Units{6} = 'm';
load 'YagiPoyntingParameters' DirectorSpacing ReflectorSpacing BL
if get(handles.Units,'Value')
index = find(round(Values(2)*10/(300/Values(1)))/10 <= BL);
else
index = find(Values(2) <= BL);
end
if isempty(index)
index = 1;
end
index = index(1);
ReflectorSpacing = ReflectorSpacing(index);
DirectorSpacing = DirectorSpacing(index);
% Director spacing
Parameters{7} = ' Director Spacing';
Values(7) = DirectorSpacing*300/Values(1);
Units{7} = 'm';
% Reflector Sapcing
Parameters{8} = 'Reflector Sapcing';
Values(8) = ReflectorSpacing*300/Values(1);
Units{8} = 'm';
% Gain
Parameters{9} = get(handles.Parameter2Txt,'String');
Values(9) = get(handles.Parameter2,'Value');
Units{9} = 'dBi';
% Element Diameter / Wavelength Ratio
Parameters{10} = get(handles.Parameter7Txt,'String');
Values(10) = get(handles.Parameter7,'Value');
Units{10} = '';
% Boom Diameter / Wavelength Ratio
if get(handles.MetalicBoom, 'Value')
Parameters{11} = get(handles.Parameter8Txt,'String');
Values(11) = get(handles.Parameter8,'Value');
Units{11} = '';
end
Summary(Parameters,Values,Units,' Yagi-Uda from Poynting Inovations',handles)
% --- Executes on button press in Grid.
function Grid_Callback(hObject, eventdata, handles)
% hObject handle to Grid (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 Grid
Graphs = findobj(gcf,'type','axes');
for i = 1:size(Graphs,1)
grid(Graphs(i))
end
% --- Executes on selection change in AntennaSelect.
function AntennaSelect_Callback(hObject, eventdata, handles)
% hObject handle to AntennaSelect (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = get(hObject,'String') returns AntennaSelect contents as cell array
% contents{get(hObject,'Value')} returns selected item from AntennaSelect
set(hObject,'BusyAction','cancel')
Antenna = get(hObject,'String');
Antenna = deblank(Antenna{get(hObject,'Value')});
if ~strcmp(Antenna,'YagiPoynting')
feval(Antenna);
close(gcbf);
end
% --- Executes during object creation, after setting all properties.
function AntennaSelect_CreateFcn(hObject, eventdata, handles)
% hObject handle to AntennaSelect (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu 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
% --- Executes on selection change in TraceSelect.
function TraceSelect_Callback(hObject, eventdata, handles)
% hObject handle to TraceSelect (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = get(hObject,'String') returns TraceSelect contents as cell array
% contents{get(hObject,'Value')} returns selected item from TraceSelect
% --- Executes during object creation, after setting all properties.
function TraceSelect_CreateFcn(hObject, eventdata, handles)
% hObject handle to TraceSelect (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu 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
% --- Executes on button press in NearestTrace.
function NearestTrace_Callback(hObject, eventdata, handles)
% hObject handle to NearestTrace (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 NearestTrace
% --- Executes on selection change in InterpSelect.
function InterpSelect_Callback(hObject, eventdata, handles)
% hObject handle to InterpSelect (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = get(hObject,'String') returns InterpSelect contents as cell array
% contents{get(hObject,'Value')} returns selected item from InterpSelect
P = findobj('Tag','Interpolated');
if ~isempty(P)
delete(P)
P = [];
end
CurrentAxes = gca;
Hand = findobj(handles.Wizard,'Type','axes');
Hand(find(Hand==handles.antenna))=[]; % Don't want handle to antenna
LineStyle = {'b','g','c','m','y','k',':b','-.b','--b'}; % Set LineStyles
for i=1:numel(Hand)
Style = 1;
set(handles.Wizard,'CurrentAxes',Hand(i))
limits = axis;
Sibs = get(Hand(i),'Children');
k = numel(Sibs);
XData = get(Sibs,'XData');
YData = get(Sibs,'YData');
Vis = get(Hand(i),'Visible');
while (k > 2)
x = XData{k};
y = YData{k};
t = x(1):(x(numel(x))-x(1))/1000:x(numel(x));
hold on
switch get(hObject,'Value')
case 1,
set(Sibs(k),'LineStyle',':')
case 2,
set(Sibs(k),'LineStyle','none')
plot(t,interp1(x,y,t,'nearest'),LineStyle{Style},...
'Tag','Interpolated','HitTest','off','Visible',Vis);
case 3,
set(Sibs(k),'LineStyle','none')
plot(t,interp1(x,y,t,'linear'),LineStyle{Style},...
'Tag','Interpolated','HitTest','off','Visible',Vis);
case 4,
set(Sibs(k),'LineStyle','none')
plot(t,interp1(x,y,t,'spline'),LineStyle{Style},...
'Tag','Interpolated','HitTest','off','Visible',Vis);
case 5,
set(Sibs(k),'LineStyle','none')
plot(t,interp1(x,y,t,'cubic'),LineStyle{Style},...
'Tag','Interpolated','HitTest','off','Visible',Vis);
end
k = k - 1;
Style = Style + 1;
end
% Make sure Crosshairs are on top!
Sibs = get(Hand(i),'Children');
x = findobj(Sibs,'Tag','XHR_XLINE');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -