📄 specifyfilter_savestrfilterobject.m
字号:
function SpecifyFilter_SaveStrFilterObject(handles)
% SpecifyFilter_SaveStrFilterObject is a subfile of the AnalogFilter GUI collection
%
% James C. Squire, 2002
% Assistant Professor, Virginia Military Institute
% ver 1.0
% SpecifyFilter_SaveStrFilterObject takes data from the SpecifyFilter GUI and stores it
% in the global variable strFilterObject
global strFilterObject
vsPurpose = get(handles.uipmPurpose,'String');
iPurpose = get(handles.uipmPurpose,'Value');
strFilterObject.sPurpose = vsPurpose{iPurpose};
vsType = get(handles.uipmType,'String');
iType = get(handles.uipmType,'Value');
strFilterObject.sType = vsType{iType};
strFilterObject.nOrder = get(handles.uipmOrder,'Value');
strFilterObject.fFc = str2num(get(handles.uitxFc,'String'))*10^((get(handles.uipmFcUnits,'Value')-2)*3);
strFilterObject.fGp = str2num(get(handles.uitxGp,'String'));
strFilterObject.fGs = str2num(get(handles.uitxGs,'String'));
strFilterObject.fGain = str2num(get(handles.uitxGain,'String'));
% create the sTitle
iUnits = get(handles.uipmFcUnits,'Value');
vsUnits = get(handles.uipmFcUnits,'String');
switch strFilterObject.nOrder
case 1, sTemp='st';
case 2, sTemp='nd';
case 3, sTemp='rd';
otherwise, sTemp='th';
end
sTitle = sprintf('%sP %g%s order %s: fc = %s%s', ...
strFilterObject.sPurpose(1),strFilterObject.nOrder, sTemp, strFilterObject.sType, ...
get(handles.uitxFc,'String'),vsUnits{iUnits} );
switch strFilterObject.sType
case {'Bessel','Butterworth'}
case 'Chebychev I'
sTitle = sprintf('%s, Gp = %g',sTitle,strFilterObject.fGp);
case 'Chebychev II'
sTitle = sprintf('%s, Gs = %g',sTitle,strFilterObject.fGs);
case 'Elliptic'
sTitle = sprintf('%s, Gp = %g, Gs = %g',sTitle,strFilterObject.fGp,strFilterObject.fGs);
otherwise
error(['In ' mfilename ' unrecognized type ' strFilterObject.sType])
end
strFilterObject.sTitle = sTitle;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -