📄 helical.m
字号:
% --- 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
P = str2double(get(hObject,'String'));
if ~isnan(P)
if P>25
P = 25;
set(hObject,'String','25');
elseif P<2.5
P = 2.5;
set(hObject,'String','2.5');
end
set(handles.rdslidecontr,'Value',(P-2.5)/(22.5));
else
set(hObject,'String',num2str(get(hObject,'Value')));
end
% --- 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
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
function Parameter7_Callback(hObject, eventdata, handles)
% hObject handle to Parameter7 (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 Parameter7 as text
% str2double(get(hObject,'String')) returns contents of Parameter7 as a double
P = get(hObject,'Value');
set(hObject,'String',num2str(P));
% --- Executes during object creation, after setting all properties.
function Parameter7_CreateFcn(hObject, eventdata, handles)
% hObject handle to Parameter7 (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 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)
HelicalInteractive(gcf,'prevx')
rotate3d off
set(handles.Rotate,'Value',0)
% --- 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)
HelicalInteractive(gcf,'prevy')
rotate3d off
set(handles.Rotate,'Value',0)
% --- 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)
HelicalInteractive(gcf,'prevy')
rotate3d off
set(handles.Rotate,'Value',0)
% --- 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)
HelicalInteractive(gcf,'prevx')
rotate3d off
set(handles.Rotate,'Value',0)
% --- 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)
HelicalInteractive(gcf,'prevx')
rotate3d off
set(handles.Rotate,'Value',0)
% --- 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)
HelicalInteractive(gcf,'prevx')
rotate3d off
set(handles.Rotate,'Value',0)
% --- 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)
HelicalInteractive(gcf,'nextx')
rotate3d off
set(handles.Rotate,'Value',0)
% --- 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)
HelicalInteractive(gcf,'nexty')
rotate3d off
set(handles.Rotate,'Value',0)
% --- 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)
HelicalInteractive(gcf,'nexty')
rotate3d off
set(handles.Rotate,'Value',0)
% --- 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)
HelicalInteractive(gcf,'nexty')
rotate3d off
set(handles.Rotate,'Value',0)
% --- 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)
HelicalInteractive(gcf,'nextx')
rotate3d off
set(handles.Rotate,'Value',0)
% --- 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)
HelicalInteractive(gcf,'nextx')
rotate3d off
set(handles.Rotate,'Value',0)
% --- 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;
% Axial Length
Parameters{2} = get(handles.Parameter1Txt,'String');
Values(2) = get(handles.Parameter1,'Value')*W1;
Units{2}= 'm';
% Number of Turns
Parameters{3} = get(handles.Parameter7Txt,'String');
Values(3) = get(handles.Parameter7,'Value');
Units{3} = '';
% Wire Length
Parameters{4} = get(handles.Parameter5Txt,'String');
Values(4) = get(handles.Parameter5,'Value')*W1;
Units{4} = 'm';
%Pitch Angle
Parameters{5} = get(handles.Parameter3Txt,'String');
Values(5) = get(handles.Parameter3,'Value');
Units{5} = 'deg';
%Turn Spacing
Parameters{6} = get(handles.Parameter8Txt,'String');
Values(6) = get(handles.Parameter8,'Value')*W1;
Units{6} = 'm';
% Gain
Parameters{7} = get(handles.Parameter2Txt,'String');
Values(7) = get(handles.Parameter2,'Value');
Units{7} = 'dBi';
% Bandwidth
Parameters{8} = get(handles.Parameter4Txt,'String');
Values(8) = get(handles.Parameter4,'Value');
Units{8} = '%';
%Wire Radius
Parameters{9} = get(handles.Parameter6Txt,'String');
Values(9) = get(handles.Parameter6,'Value');
Units{9} = 'mm';
Summary(Parameters,Values,Units,' Axial Mode Helical Antenna',handles,'3d')
% --- 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,'Helical')
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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -