GUI控件应用Plotting Data to Axes59Word下载.docx

上传人:b****3 文档编号:16925722 上传时间:2022-11-27 格式:DOCX 页数:4 大小:92.44KB
下载 相关 举报
GUI控件应用Plotting Data to Axes59Word下载.docx_第1页
第1页 / 共4页
GUI控件应用Plotting Data to Axes59Word下载.docx_第2页
第2页 / 共4页
GUI控件应用Plotting Data to Axes59Word下载.docx_第3页
第3页 / 共4页
GUI控件应用Plotting Data to Axes59Word下载.docx_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

GUI控件应用Plotting Data to Axes59Word下载.docx

《GUI控件应用Plotting Data to Axes59Word下载.docx》由会员分享,可在线阅读,更多相关《GUI控件应用Plotting Data to Axes59Word下载.docx(4页珍藏版)》请在冰豆网上搜索。

GUI控件应用Plotting Data to Axes59Word下载.docx

3.

(1)修改两个Axes属性,使用默认值,tag分别为axes1和axes2

(2)修改第一个Pushbutton属性:

(3)类似地,修改第二个Pushbutton属性:

String为PlotAxes2;

Tag为plot2_pushbutton

(4)修改第三个Pushbutton属性:

String为ClearAxes;

Tag为clearAxes_pushbutton

此时,得到:

4.

(1)plot1_pushbutton_Callback.加入以下代码

%selectsaxes1asthecurrentaxes,sothatMatlabknowswheretoplot

%thedata

axes(handles.axes1)

%createsavectorfrom0to10,[0123...10]

x=0:

10;

y=0:

%plotsthexandydata

plot(x,y);

%画的是y=x的图

%addsatitle,x-axisdescription,andy-axisdescription

title('

Axes1'

);

xlabel('

Xdata'

ylabel('

Ydata'

guidata(hObject,handles);

%updatesthehandles

(2)plot2_pushbutton_Callback.加入以下代码

%selectsaxes2asthecurrentaxes,sothatMatlabknowswheretoplot%thedata

axes(handles.axes2)

%createsavector[0149...100]

y=x.^2;

Axes2'

(3)clearPlots_pushbutton_Callback.加入以下代码

%thesetwolinesofcodeclearsbothaxes

cla(handles.axes1,'

reset'

)%cladeletesfromthecurrentaxesall

%graphicsobjectswhosehandlesarenothidden

cla(handles.axes2,'

5.保存,并执行

6.如果在functionmyaxes_OpeningFcn(在.m文件中找到该函数),中加入

set(hObject,'

toolbar'

'

figure'

%加在guidata(hObject,handles);

则能在GUI中增加图形操作栏:

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 幼儿教育 > 少儿英语

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1