📄 yagipoynting.m
字号:
uiwait(Warn);
else notValid = 0;
end
end
if ~notValid
Certain = questdlg('Are you sure you want to save parameters?','Save','Yes','No','Yes');
if strcmp(Certain,'Yes')
save 'YagiPoyntingParameters' BL RL N Gain DL Driven...
DirectorSpacing ReflectorSpacing % Save new parameters
Msg = msgbox({'Restart to view changes'},'Saved')
set(Msg,'WindowStyle','modal')
uiwait(Msg);
end
end
%%%%%%%%%% RELOAD YAGIPOYNTING m-file %%%%%%%%%%%%%%%%%%%
% --- Executes on button press in FullScreen.
function FullScreen_Callback(hObject, eventdata, handles)
% hObject handle to FullScreen (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
FullScreenEdit(gca,handles);
% --- Executes on button press in InterpHelp.
function InterpHelp_Callback(hObject, eventdata, handles)
% hObject handle to InterpHelp (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
Msg = msgbox({strcat('Interpolation is the process of constructing new ',...
' data points from a discrete set of known data points. '),' ',...
strcat('The method of interpolation effects the ''accuracy'' of each new point. ',...
'Try selecting different interpolation methods to see the interpolated curve associated with each. '),' ',...
' Points are drawn connected with default linear interpolation.'},'Interpolation Help');
set(Msg,'WindowStyle','modal');
% --- 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 MetalicBoom.
function MetalicBoom_Callback(hObject, eventdata, handles)
% hObject handle to MetalicBoom (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 MetalicBoom
if ~get(hObject,'Value')
Status = 'off';
else
Status = 'on';
end
set(handles.Parameter8Txt','Enable',Status);
set(handles.Parameter8','Enable',Status);
set(handles.BoomSlider','Enable',Status);
set(handles.BoomSlider,'Value',...
get(handles.Parameter8,'Value')/0.0350 - 0.005/0.0350)
Compensate(handles,get(handles.Parameter8,'Value'),Status);
% --- Executes on slider movement.
function BoomSlider_Callback(hObject, eventdata, handles)
% hObject handle to BoomSlider (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,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
Compensate(handles,get(handles.Parameter8,'Value'),'off');
set(handles.Parameter8,'Value',get(hObject,'Value')*0.0350 + 0.005)
set(handles.Parameter8,'String',num2str(get(hObject,'Value')*0.0350 + 0.005,'%1.4f'))
Compensate(handles,get(handles.Parameter8,'Value'),'on');
% --- Executes during object creation, after setting all properties.
function BoomSlider_CreateFcn(hObject, eventdata, handles)
% hObject handle to BoomSlider (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background, change
% 'usewhitebg' to 0 to use default. See ISPC and COMPUTER.
usewhitebg = 1;
if usewhitebg
set(hObject,'BackgroundColor',[.9 .9 .9]);
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
function Parameter8_Callback(hObject, eventdata, handles)
% hObject handle to Parameter8 (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 Parameter8 as text
% str2double(get(hObject,'String')) returns contents of Parameter8 as a double
r = str2double(get(hObject,'String'));
if ~isnan(r)
if r<0.005
r = 0.005;
elseif r>0.040
r = 0.040;
end
Compensate(handles,get(hObject,'Value'),'off');
set(hObject,'Value',r);
set(hObject,'String',num2str(r));
set(handles.BoomSlider,'Value',r/0.0350 - 0.005/0.0350)
Compensate(handles,r,'on');
else
set(hObject,'String',num2str(get(hObject,'Value')));
end
function Compensate(handles,r,Status);
if get(handles.Units,'Value')
f = get(handles.Frequency,'Value');
lambda = 300/f;
else
lambda = 1;
end
LengthExtra = (0.75*r + 0.0012)*lambda;
if strcmp(Status,'off')
LengthExtra = - LengthExtra;
end
yAdd(handles.axes3,LengthExtra);
yAdd(handles.axes4,LengthExtra);
Interactive(handles.Wizard,'draw');
% Scale curves' xdata
function xAdd(Ax,Length)
xaxis = get(Ax,'XLim');
Data = get(Ax,'UserData');
Data.xdata = Data.xdata + Length;
Data.xpoint = Data.xpoint + Length;
Data.x_rng = Data.x_rng + Length;
set(Ax,'UserData',Data);
set(Ax,'XLim',xaxis + Length);
Lines = get(Ax,'Children');
k = numel(Lines);
while k>2 % Top 2 are crosshairs
set(Lines(k),'XData',get(Lines(k),'XData') + Length);
k = k - 1;
end
% Scale curves' ydata
function yAdd(Ax,Length)
yaxis = get(Ax,'YLim');
Data = get(Ax,'UserData');
Data.ydata = Data.ydata + Length;
Data.ypoint = Data.ypoint + Length;
Data.y_rng = Data.y_rng + Length;
set(Ax,'UserData',Data);
set(Ax,'YLim',yaxis + Length);
Lines = get(Ax,'Children');
k = numel(Lines);
while k>2 % Top 2 are crosshairs
set(Lines(k),'YData',get(Lines(k),'YData') + Length);
k = k - 1;
end
% --- Executes during object creation, after setting all properties.
function Parameter8_CreateFcn(hObject, eventdata, handles)
% hObject handle to Parameter8 (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 slider movement.
function DiamSlider_Callback(hObject, eventdata, handles)
% hObject handle to DiamSlider (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,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
Scale(handles,get(handles.Parameter7,'Value'),'off');
set(handles.Parameter7,'Value',get(hObject,'Value')*0.0104 + 0.001)
set(handles.Parameter7,'String',....
num2str(get(hObject,'Value')*0.0104 + 0.001,'%1.4f'))
Scale(handles,get(handles.Parameter7,'Value'),'on');
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
r = str2double(get(hObject,'String'));
if ~isnan(r)
if r<0.001
r = 0.001;
elseif r>0.0114
r = 0.0114;
end
Scale(handles,get(hObject,'Value'),'off');
set(hObject,'Value',r);
set(hObject,'String',num2str(r));
set(handles.DiamSlider,'Value',...
r/0.0104 - 0.001/0.0104)
Scale(handles,r,'on');
else
set(hObject,'String',num2str(get(hObject,'Value')));
end
function Scale(handles,r,Status)
if get(handles.Units,'Value')
f = get(handles.Frequency,'Value');
lambda = 300/f;
else
lambda = 1;
end
ReflectorScale = -2.86*r + 1.023;
if r <= 0.005
DirectorScale = -5*r + 1.065;
elseif (r == 0.008)
DirectorScale = 1;
elseif (r>0.005 & r <= 0.00982)
DirectorScale = -(13+1/3)*r + 1.1;
elseif (r>0.00982 & r<=0.0114)
DirectorScale = -18.99*r + 1.15;
end
if strcmp(Status,'off')
ReflectorScale = 1/ReflectorScale;
DirectorScale = 1/DirectorScale;
end
yScale(handles.axes3,ReflectorScale);
yScale(handles.axes4,DirectorScale);
Interactive(handles.Wizard,'draw');
% --- Executes during object creation, after setting all properties.
function DiamSlider_CreateFcn(hObject, eventdata, handles)
% hObject handle to DiamSlider (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background, change
% 'usewhitebg' to 0 to use default. See ISPC and COMPUTER.
usewhitebg = 1;
if usewhitebg
set(hObject,'BackgroundColor',[.9 .9 .9]);
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --------------------------------------------------------------------
function DesignCurves_Callback(hObject, eventdata, handles)
% hObject handle to DesignCurves (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
string = {' Design Curves by NBS, ',...
'Modified by Lawson and Poynting Inovations',' ',...
' Poynting Inovations '};
Msg=msgbox(string,'About Design Curves');
set(Msg,'WindowStyle','modal');
% --- Executes during object creation, after setting all properties.
function TraceSwitch_CreateFcn(hObject, eventdata, handles)
% hObject handle to TraceSwitch (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 View_Callback(hObject, eventdata, handles)
% hObject handle to View (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
ViewGraphs(handles)
% --------------------------------------------------------------------
function Untitled_2_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function Edit_Callback(hObject, eventdata, handles)
% hObject handle to Edit (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function ViewMenu_Callback(hObject, eventdata, handles)
% hObject handle to ViewMenu (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -