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

📄 shili36.m

📁 matlab实例编程一百个源程序,包含了各个方面的实例编程
💻 M
字号:
h0=figure('toolbar','none',...
    'position',[200 150 450 250],...
    'name','实例36');
x=0:0.5:2*pi;
y=sin(x);
h=plot(x,y);
grid on
hm=uicontrol(gcf,'style','popupmenu',...
    'string',...
    'sin(x)|cos(x)|sin(x)+cos(x)|exp(-sin(x))',...
    'position',[250 20 50 20]);
set(hm,'value',1)
huidiao=[...
        'v=get(hm,''value'');,',...
        'switch v,',...
        'case 1,',...
        'delete(h),',...
        'y=sin(x);,',...
        'h=plot(x,y);,',...
        'grid on,',...
        'case 2,',...
        'delete(h),',...
        'y=cos(x);,',...
        'h=plot(x,y);,',...
         'grid on,',...
        'case 3,',...
        'delete(h),',...
        'y=sin(x)+cos(x);,',...
        'h=plot(x,y);,',...
         'grid on,',...
        'case 4,',...
        'delete(h),',...
        'y=exp(-sin(x));,',...
        'h=plot(x,y);,',...
         'grid on,',...
        'end'];
set(hm,'callback',huidiao)
set(gca,'position',[0.2 0.2 0.6 0.6])
title('弹出式菜单的使用')
hold on

⌨️ 快捷键说明

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