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

📄 demo6.m

📁 详细介绍了Mathlab的使用方法与技巧
💻 M
字号:
%**********************
%由状态方程求系统的阶跃响应曲线
wind_demo13=figure('color',[1,1,1],'position',[0.1*winw,0.1*winh,0.8*winw,0.8*winh],...
       'name','习题演示窗口6:由状态方程求系统的阶跃响应曲线','numbertitle','off','menubar','none',...
        'resize','off','clipping','off');
color=[0.9;.9;.9];
uicontrol('style','frame','position',[0,0,1,1],...
   'units','normalized','backgroundcolor',color);
pos=[0.02,0.92,0.25,0.04];
showtext(pos,color,'输入系统状态空间');
color=[.8;.8;0.8];
uicontrol('style','frame','position',[0.02,0.68,.85,.23],...
   'units','normalized','backgroundcolor',color);
pos=[0.03,0.85,0.04,0.04];
showtext(pos,color,'A:');
demo_edita=uicontrol(wind_demo13,'style','edit','pos',[0.08,0.85,0.77,0.04],...
        'string','[]','back',[0,0.7,1],'units','normalized');
pos=[0.03,0.8,0.04,0.04];
showtext(pos,color,'B:');
demo_editb=uicontrol(wind_demo13,'style','edit','pos',[0.08,0.8,0.77,0.04],...
        'string','[]','back',[0,0.7,1],'units','normalized');
pos=[0.03,0.75,0.04,0.04];
showtext(pos,color,'C:');
demo_editc=uicontrol(wind_demo13,'style','edit','pos',[0.08,0.75,0.77,0.04],...
        'string','[]','back',[0,0.7,1],'units','normalized');
pos=[0.03,0.7,0.04,0.04];
showtext(pos,color,'D:');
demo_editd=uicontrol(wind_demo13,'style','edit','pos',[0.08,0.7,0.77,0.04],...
        'string','[0]','back',[0,0.7,1],'units','normalized');
%################
str=['demoa=eval(get(demo_edita,''string''));demob=eval(get(demo_editb,''string''));',...
      'democ=eval(get(demo_editc,''string''));demod=eval(get(demo_editd,''string''));',...
      't=[0:0.01:10];',...
      'windstep2=figure(''color'',[0,0,0],''position'',[0.1*winw,0.1*winh,0.8*winw,0.8*winh],',...
      '                ''name'',''系统阶跃响应曲线'',''numbertitle'',''off'',''menubar'',''none'',',...
      '                ''resize'',''off'');',...
      '[y,x]=step(demoa,demob,democ,demod,1,t);',...
      'plot(t,y,t,x);axis;',...
      'grid;ylabel(''输出Y和X(t)'');title(''系统阶跃响应曲线'');',...
      'uicontrol(windstep2,''style'',''push'',''string'',''Close'',',...
      '            ''position'',[0.425,0.05,0.15,0.06],''units'',''normalized'',',...
      '            ''callback'',''close(windstep2)'');']
uicontrol(wind_demo13,'style','push','string','阶跃响应',...
       'position',[0.85,0.5,0.13,0.06],'units','normalized',...
      'callback',str);
uicontrol(wind_demo13,'style','push','string','Close',...
       'position',[0.85,0.3,0.13,0.06],'units','normalized',...
      'callback','close(wind_demo13)');
%####################

⌨️ 快捷键说明

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