📄 main.m
字号:
clear all;
clc
HF0 = figure('Units','characters', ...
'Color',[0.925 0.914 0.847], ...
'FileName','d:\tank\form.m', ...
'PaperPosition',[18 180 576 432], ...
'PaperUnits','points', ...
'Position',[50 20 112 32], ...
'Tag','Figure1', ...
'ToolBar','auto');
%*************Edit********************
HF1 = uicontrol('Parent',HF0, ...
'Units','characters', ...
'Callback','calculation',...
'BackgroundColor',[1 1 1], ...
'FontSize',8, ...
'ListboxTop',1.0, ...
'Position',[26 22 8 1.5], ...
'String','15', ...
'Style','edit', ...
'Tag','Base_Radius');
HF2 = uicontrol('Parent',HF0, ...
'Units','characters', ...
'Callback','calculation',...
'BackgroundColor',[1 1 1], ...
'FontSize',8, ...
'ListboxTop',1.0, ...
'Position',[77 22 7 1.5], ...
'String','2', ...
'Style','edit', ...
'Tag','Hole_Radius');
HF3 = uicontrol('Parent',HF0, ...
'Units','characters', ...
'Callback','calculation',...
'BackgroundColor',[1 1 1], ...
'FontSize',8, ...
'ListboxTop',1.0, ...
'Position',[52 15 8 1.5], ...
'String','20', ...
'Style','edit', ...
'Tag','Height');
HF4 = uicontrol('Parent',HF0, ...
'Units','characters', ...
'Callback','Tank(''Time_Callback'',gcbo,[],guidata(gcbo))',...
'BackgroundColor',[1 1 1], ...
'FontSize',8, ...
'ListboxTop',1.0, ...
'Position',[45 4.7 10 1.5], ...
'String','1', ...
'Style','edit', ...
'Tag','Time');
%****************Text Box************************
HF5 = uicontrol('Parent',HF0, ...
'Units','characters', ...
'BackgroundColor',[.925 .914 .847], ...
'FontSize',8, ...
'ListboxTop',1.0, ...
'Position',[20 22 6 1.25], ...
'String','R = ', ...
'Style','text', ...
'Tag','text1');
HF6 = uicontrol('Parent',HF0, ...
'Units','characters', ...
'BackgroundColor',[.925 .914 .847], ...
'FontSize',8, ...
'ListboxTop',1.0, ...
'Position',[70 22 6 1.25], ...
'String','r = ', ...
'Style','text', ...
'Tag','text2');
HF7 = uicontrol('Parent',HF0, ...
'Units','characters', ...
'BackgroundColor',[.925 .914 .847], ...
'FontSize',8, ...
'ListboxTop',1.0, ...
'Position',[45 15 6 1.25], ...
'String','h = ', ...
'Style','text', ...
'Tag','text1');
HF8 = uicontrol('Parent',HF0, ...
'Units','characters', ...
'BackgroundColor',[.925 .914 .847], ...
'FontSize',8, ...
'ListboxTop',1.0, ...
'Position',[38 4.4 6 1.5], ...
'String','t = ', ...
'Style','text', ...
'Tag','text4');
%****************Sliders********************
HF9 = uicontrol('Parent',HF0, ...
'Units','characters', ...
'Callback','calculation2',...
'BackgroundColor',[.9 .9 .9], ...
'FontSize',8, ...
'ListboxTop',1.0, ...
'Position',[10 24 40 1.5], ...
'Style','slider', ...
'Max',100,...
'Min',0,...
'Value',15,...
'Tag','Base_Radius_Slider');
HF10 = uicontrol('Parent',HF0, ...
'Units','characters', ...
'Callback','calculation2',...
'BackgroundColor',[.9 .9 .9], ...
'FontSize',8, ...
'ListboxTop',1.0, ...
'Position',[60 24 40 1.5], ...
'Style','slider', ...
'Max',100,...
'Min',0,...
'Value',2,...
'Tag','Hole_Radius_Slider');
HF11 = uicontrol('Parent',HF0, ...
'Units','characters', ...
'Callback','calculation2',...
'BackgroundColor',[.9 .9 .9], ...
'FontSize',8, ...
'ListboxTop',1.0, ...
'Position',[35 17 40 1.5], ...
'Style','slider', ...
'Max',100,...
'Min',0,...
'Value',20,...
'Tag','Height_Radius');
%*****************push buttons*******************************
HF12 = uicontrol('Parent',HF0, ...
'Units','characters', ...
'BackgroundColor',[.925 .914 .847], ...
'Callback','plotfig', ...
'FontSize',8, ...
'ListboxTop',0, ...
'Position',[35 10 14 2], ...
'String','Plot', ...
'Tag','Plot');
HF13 = uicontrol('Parent',HF0, ...
'Units','characters', ...
'BackgroundColor',[.925 .914 .847], ...
'Callback','helpmsg', ...
'FontSize',8, ...
'ListboxTop',0, ...
'Position',[55 10 14 2], ...
'String','Help', ...
'Tag','Help');
%*********************Popupmenu***********************
HF14 = uicontrol('Parent',HF0, ...
'Units','characters', ...
'Callback','calculation', ...
'BackgroundColor',[1 1 1], ...
'FontSize',8, ...
'ListboxTop',1.0, ...
'Position',[58 5 20 1.25], ...
'String',{'Second','Minute','Hour'}, ...
'Style','popupmenu', ...
'Tag','popupmenu2');
calculation
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -