⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shili63.m

📁 MATLAB实例编程一百个源程序,这里面有图象处理,数值计算等.
💻 M
字号:
h0=figure('toolbar','none',...
    'position',[200 150 350 200],...
    'name','实例63');
choose=1;
e1=uicontrol('parent',h0,...
    'units','points',...
    'tag','e1',...
    'style','edit',...
    'backgroundcolor',[1 1 1],...
    'min',0,...
    'max',2,...
    'fontsize',12,...
    'horizontalalignment','left',...
    'position',[20 20 120 100]);
t1=uicontrol('parent',h0,...
    'units','points',...
    'tag','t1',...
    'style','text',...
    'string','请输入字母(大小写皆可):',...
    'fontsize',10,...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[20 125 120 15]);
b1=uicontrol('parent',h0,...
    'units','points',...
    'tag','b1',...
    'style','pushbutton',...
    'string','开始统计',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[180 100 60 20],...
    'callback',[...
        's=get(e1,''string'');,',...
        'n=length(s);,',...
        'jb=0;,',...
        'jl=0;,',...
        'for i=1:n,',...
        'if (abs(s(i))>64)&(abs(s(i))<91),',...
        'jb=jb+1;,',...
        'end,',...
        'if (abs(s(i))>96)&(abs(s(i))<123),',...
        'jl=jl+1;,',...
        'end,',...
        'end,',...
        'j=jb+jl;,',...
        'if choose==1,',...
        'msgbox([''共有字母'',num2str(j),''个!'',''其中大写字母'',num2str(jb),''个!''],''统计结果''),',...
        'end,',...
        'if choose==2,',...
        'msgbox([''共有字母'',num2str(j),''个!'',''其中小写字母'',num2str(jl),''个!''],''统计结果'');,',...
        'end']);
u1=uimenu('parent',h0,...
    'label','字母分类',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'tag','u1');
u11=uimenu('parent',u1,...
    'label','大写字母',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'tag','u11',...
    'checked','on',...
    'callback',[...
        'set(u11,''checked'',''on'');,',...
        'set(u12,''checked'',''off'');,',...
        'choose=1;']);
u12=uimenu('parent',u1,...
    'label','小写字母',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'tag','u12',...
     'callback',[...
        'set(u12,''checked'',''on'');,',...
        'set(u11,''checked'',''off'');,',...
        'choose=2;']);
b2=uicontrol('parent',h0,...
    'units','points',...
    'tag','b2',...
    'style','pushbutton',...
    'string','清除',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[180 60 60 20],...
    'callback','set(e1,''string'','''')');
b3=uicontrol('parent',h0,...
    'units','points',...
    'tag','b3',...
    'style','pushbutton',...
    'string','关闭',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'position',[180 20 60 20],...
    'callback','close');

⌨️ 快捷键说明

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