📄 change_time2.m
字号:
function change_time(index)
% Change time scale of PID-1Df plot
% ---------------------------------
global time st_size keep old_handle
switch index
case 'main'
keep=0; %clear keepimg existimg plot
old_handle=gcf;
fct=crfig(5,200,300,211,'Change parameters','w','none','off');
uicontrol(fct,...
'Style','text',...
'Position',[50 150 80 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'HorizontalAlignment','Left',...
'String','Final time:');
uicontrol(fct,...
'Style','text',...
'Position',[50 120 80 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'HorizontalAlignment','Left',...
'String','Max. Step size:');
uicontrol(fct,...
'Style','frame',...
'Position',[140 117 100 54],...
'Backgroundcolor','w',...
'Foregroundcolor','k');
uicontrol(fct,...
'Style','edit',...
'Position',[145 150 90 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'String',num2str(time),...
'Callback','change_time(''time'');');
uicontrol(fct,...
'Style','edit',...
'Position',[145 120 90 18],...
'Backgroundcolor','w',...
'Foregroundcolor','k',...
'String',num2str(st_size),...
'Callback','change_time(''step'');');
uicontrol(fct,...
'Style','push',...
'Position',[110 20 80 25],...
'String','OK',...
'Callback',['close,',...
'JMENU=IMENU;',...
'cback;']);
case 'time'
temp=get(gcbo,'String');
if isletter(temp) | str2num(temp) <= 0
errordlg('Enter a number greater than zero!');
else
time=str2num(temp);
end
case 'step'
temp=get(gcbo,'String');
st_size=str2num(temp);
if st_size <= 0 | st_size >= 2 ;
errordlg('Enter a number > 0 and < 2.');
else
st_size=str2num(temp);
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -