MATLAB与系统仿真 - 图文

2026/1/20 14:03:00

'for k=1:length(z);',...

'y(:,k)=step(1,[1 2*z(k) 1],t);',... 'plot(t,y(:,k));',...

'if (length(z)>1) ,hold on,end,',... 'end;',...

'hold off,']);

h_push1=uicontrol(h_fig,'style','push',...

'unit','normalized','position',[0.67,0.37,0.12,0.15],... 'string','grid on','callback','grid on'); h_push2=uicontrol(h_fig,'style','push',...

'unit','normalized','position',[0.67,0.15,0.12,0.15],... 'string','grid off','callback','grid off'); 得到以下图行

在程序“text(0.12,0.93,str,'fontsize',13); h_fig=get(H,'parent')”后面加入程序段

set(h_fig, 'MenuBar','none')

h_menu=uimenu(gcf,'label','Options');

h_sub3=uimenu(h_menu,'label','box on','callback','box on',...

16

'separator','on'); h_sub4=uimenu(h_menu,'label','box off','callback','box off');

得到以下图形

在程序'if (length(z)>1) ,hold on,end,',...; 'end;',...;'hold off,']);后面加入以下程序段

h_menu=uimenu(gcf,'label','Color');

h_submenu1=uimenu(h_menu,'label','Blue',... 'callback','set(plot(t,y),''Color'',''b'')'); h_submenu1=uimenu(h_menu,'label','Green',... 'callback','set(plot(t,y),''Color'',''g'')'); h_submenu1=uimenu(h_menu,'label','yellow',... 'callback','set(plot(t,y),''Color'',''y'')'); h_submenu1=uimenu(h_menu,'label','cyan',... 'callback','set(plot(t,y),''Color'',''c'')'); h_submenu2=uimenu(h_menu,'label','Red',... 'callback','set(plot(t,y),''color'',''r''),'); 并且输入阻尼比,就可以得到以下图像

17

2、GUI控件形式方法

(1)新建一个GUI文件完成文件的创建

18

图中的每个原始文件都以图中名称命名。

(2) 工具栏设置option、color工具,如图示

(3) 运行(1)图的时候弹出“Editor”文件,修改文件,保存为为oo.m程序,

运行程序可以得到下面图形

19


MATLAB与系统仿真 - 图文.doc 将本文的Word文档下载到电脑
搜索更多关于: MATLAB与系统仿真 - 图文 的文档
相关推荐
相关阅读
× 游客快捷下载通道(下载后可以自由复制和排版)

下载本文档需要支付 10

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:xuecool-com QQ:370150219