📄 yagiuda.m
字号:
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(8,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.Parameter2Txt,'String');
Values(3) = get(handles.Parameter2,'Value');
Units{3} = '';
% Reflector Length
Parameters{4} = get(handles.Parameter4Txt,'String');
Values(4) = get(handles.Parameter4,'Value')*W1;
Units{4} = 'm';
Parameters{5} = 'Director Length';
Values(5) = Values(4)/get(handles.Parameter5,'Value');
Units{5} = 'm';
Parameters{6} = 'Element Spacing';
Values(6) = ((Values(2)/(Values(3)-1))*W1);
Units{6} = 'm';
% Gain
Parameters{7} = get(handles.Parameter3Txt,'String');
Values(7) = get(handles.Parameter3,'Value');
Units{7} = 'dBi';
% Bandwidth
Parameters{8} = get(handles.Parameter6Txt,'String');
Values(8) = get(handles.Parameter6,'Value');
Units{8} = '%';
Summary(Parameters,Values,Units,' Yagi-Uda',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
Antenna = get(hObject,'String');
Antenna = deblank(Antenna{get(hObject,'Value')});
if ~strcmp(Antenna,'YagiUda')
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');
y = findobj(Sibs,'Tag','XHR_YLINE');
Temp = Sibs;
Sibs = zeros(2,1);
Sibs(1) = x;
Sibs(2) = y;
Temp(find(Temp == x)) = [];
Temp(find(Temp == y)) = [];
Sibs = [Sibs;Temp];
set(Hand(i),'Children',Sibs)
hold off
axis(limits)
end
set(handles.Wizard,'CurrentAxes',CurrentAxes);
% --- Executes during object creation, after setting all properties.
function InterpSelect_CreateFcn(hObject, eventdata, handles)
% hObject handle to InterpSelect (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
function Interval_Callback(hObject, eventdata, handles)
% hObject handle to Interval (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 Interval as text
% str2double(get(hObject,'String')) returns contents of Interval as
% a double
Val = str2double(get(hObject,'String'));
if Val ~= NaN
set(hObject,'Value',Val)
end
% --- Executes during object creation, after setting all properties.
function Interval_CreateFcn(hObject, eventdata, handles)
% hObject handle to Interval (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
% --- Executes on button press in Zoom.
function Zoom_Callback(hObject, eventdata, handles)
% hObject handle to Zoom (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -