📄 change_p.m
字号:
function change_P(index,x,Epsilon)
% change process parameters of MSF time response
global keep old_handle
if isempty(keep)
keep=0;
end
switch index
case 'main'
old_handle=gcf;
f=crfig(5,200,300,231,'Change parameters','w','none','off');
uicontrol(f,...
'Style','text',...
'Position',[20 190 150 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'HorizontalAlignment','Left',...
'String','Uncertain parameters:');
uicontrol(f,...
'Style','checkbox',...
'Position',[20 50 150 18],...
'Value',keep,...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'HorizontalAlignment','Left',...
'String','keep the existing plot',...
'Callback','change_P(''keep'');');
uicontrol(f,...
'Style','text',...
'Position',[20 165 260 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'HorizontalAlignment','Left',...
'String','Enter the values of x(1), x(2), ...');
uicontrol(f,...
'Style','frame',...
'Position',[20 137 260 24],...
'Backgroundcolor','w',...
'Foregroundcolor','k');
temp='';
for i=1:length(x);
temp=[temp num2str(x(i)) ' '];
end
uicontrol(f,...
'Style','edit',...
'Position',[25 140 250 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'String',temp,...
'Callback',['temp=str2num(get(gcbo,''String''));',...
'if ~isempty(temp)&(length(temp)~=length(vub) | any(temp>vub) | any(temp<vlb)) ',...
'errordlg(''Size does not match, or infeasible'');',...
'else x=temp; end']);
uicontrol(f,...
'Style','text',...
'Position',[20 110 260 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'HorizontalAlignment','Left',...
'String','Enter the filter time conmstant e:');
uicontrol(f,...
'Style','frame',...
'Position',[20 77 120 24],...
'Backgroundcolor','w',...
'Foregroundcolor','k');
uicontrol(f,...
'Style','edit',...
'Position',[25 80 110 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'String',num2str(Epsilon),...
'Callback',['Epsilon{1,1}=str2num(get(gcbo,''String''));']);
uicontrol(f,...
'Style','push',...
'Position',[110 20 80 25],...
'String','OK',...
'Callback',['temp=get(gcf,''Child''); ',...
'x=str2num(get(temp(5),''String'')); ',...
'if degree_freedom~=length(Epsilon{1,1}) '...
' errordlg(''Size of Epsilon does not match!'');',...
'elseif isempty(x)|(length(x)==length(vlb) & all(x<=vub) & all(x>=vlb)) close;JMENU=IMENU;cback;',...
'else errordlg(''size of x does not match, or infeasible''); end']);
case 'keep'
keep=get(gcbo,'Value');
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -