shili35.m

来自「matlab6.0时尚设计百例的30-40个程序代码」· M 代码 · 共 34 行

M
34
字号
h0=figure('toolbar','none',...
    'position',[200 150 350 250],...
    'name','实例35');
f='please input the letter';
huidiao1=['g=upper(f);,',...
    'set(h2_edit,''string'',g)',...
    ];
huidiao2=[...
    'g=lower(f);,',...
    'set(h2_edit,''string'',g),',...
    ];
h1_edit=uicontrol(gcf,'style','edit',...
    'position',[100 200 100 50],...
    'HorizontalAlignment','left',...
    'string','please input the letter',...
    'callback','f=get(h1_edit,''string'');',...
    'background','w',...
    'max',5,...
    'min',1);
h2_edit=uicontrol(gcf,'style','edit',...
    'HorizontalAlignment','left',...
    'position',[100 100 100 50],...
    'background','w',...
    'max',5,...
    'min',1);
h1_button=uicontrol(gcf,'style','pushbutton',...
    'string','小写变大写',...
    'position',[100 45 100 20],...
    'callback',huidiao1);
h2_button=uicontrol(gcf,'style','pushbutton',...
    'string','大写变小写',...
    'position',[100 20 100 20],...
    'callback',huidiao2);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?