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

📄 untitledleizi.m

📁 matla窗口制作
💻 M
字号:
PlotSin=[
    'Num=get(hs,''value'');'...
    'set(heNum,''string'',num2str(Num));'...
    'subplot(ha);'...
    'plot(x,sin(x));'...
    'axis([0 Num*pi -1 1]);'...
    'xlabel(''x'');'...
    'ylabel(''y=sin(x)'');'...
    'if get(hcGrid,''Value'')==1;'...
    'grid on;'...
    'else;'...
    'grid off;'...
    'end;']    
hf=figure('position',[200 200 600 400],...
    'name','uicontrol',...
    'numbertitle','off');
ha=axes('position',[0.4 0.1 0.5 0.7],...
    'box','on');
hbSin=uicontrol(hf,...
    'style','push','position',[50 140 100 30],...
    'string','Plot sin(x)',...
    'Callback',PlotSin);
    
heNum=uicontrol(hf,'style','edit',...
    'position',[50 270 100 20],...
    'max',20,'min',0,...
    'string','4',...
    'callback','set(heNum,''string'',num2str(Num))');
hs=uicontrol(hf,'style','slider','position',[150 310 100 20],...
    'value',4,'Min',1,'Max',20,...
    'callback',PlotSin);
 

    

⌨️ 快捷键说明

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