实例38.m

来自「程序实例」· M 代码 · 共 26 行

M
26
字号
h0=figure('toolbar','none',...
    'position',[200 150 450 250],...
    'name','实例38');
[x,y]=meshgrid(-8:0.5:8);
r=sqrt(x.^2+y.^2)+eps;
z=sin(r)./r;
h0=mesh(x,y,z);
hlist=uicontrol(gcf,'style','listbox',...
    'string','default|spring|summer|autumn|winter',...
    'max',5,...
    'min',1,...
    'position',[20 20 80 100],...
    'callback',[...
        'k=get(hlist,''value'');,',...
        'switch k,',...
        'case 1,',...
        'colormap default,',...
        'case 2,',...
        'colormap spring,',...
        'case 3,',...
        'colormap summer,',...
        'case 4,',...
        'colormap autumn,',...
        'case 5,',...
        'colormap winter,',...
        'end']);

⌨️ 快捷键说明

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