求解释下这个matlab程序 各种不懂啊!h0=figure('toolbar','none',...'position',[198 56 408 468],...'name','实例50');h1=axes('parent',h0,...'position',[0.29 0.45 0.7 0.5],...'visible','on');f=uicontrol('parent',h0,...'style','frame',...'pos
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/17 15:55:00
求解释下这个matlab程序 各种不懂啊!h0=figure('toolbar','none',...'position',[198 56 408 468],...'name','实例50');h1=axes('parent',h0,...'position',[0.29 0.45 0.7 0.5],...'visible','on');f=uicontrol('parent',h0,...'style','frame',...'pos
求解释下这个matlab程序 各种不懂啊!
h0=figure('toolbar','none',...
'position',[198 56 408 468],...
'name','实例50');
h1=axes('parent',h0,...
'position',[0.29 0.45 0.7 0.5],...
'visible','on');
f=uicontrol('parent',h0,...
'style','frame',...
'position',[5 50 90 400]);
p1=uicontrol('parent',h0,...
'style','pushbutton',...
'position',[150 100 60 40],...
'string','绘图',...
'callback',[...
'm=str2num(get(e1,''string''));,',...
'n=str2num(get(e2,''string''));,',...
'a=get(l1,''value'');,',...
'x=m:0.1:n;',...
'if a==1,',...
'plot(x,sin(x)),',...
'end,',...
'if a==2,',...
'plot(x,cos(x)),',...
'end,',...
'if a==3,',...
'plot(x,exp(x)),',...
'end']);
p2=uicontrol('parent',h0,...
'style','pushbutton',...
'position',[270 100 60 40],...
'string','关闭',...
'callback','close');
l1=uicontrol('parent',h0,...
'style','listbox',...
'position',[10 300 80 80],...
'string','sin(x)|cos(x)|exp(x)',...
'value',1,...
'max',0.5,...
'min',0);
f2=uicontrol('parent',h0,...
'style','text',...
'string','选择函数',...
'fontsize',10,...
'position',[10 380 80 20]);
r1=uicontrol('style','radio',...
'string','grid on',...
'value',0,...
'position',[10 100 60 20],...
'callback',[...
'grid on,',...
'set(r1,''value'',1);,',...
'set(r2,''value'',0)']);
r2=uicontrol('style','radio',...
'string','grid off',...
'position',[10 80 60 20],...
'value',1,...
'callback',[...
'grid off,',...
'set(r2,''value'',1);,',...
'set(r1,''value'',0)']);
e1=uicontrol('parent',h0,...
'style','edit',...
'string',0,...
'position',[20 210 60 20],...
'horizontalalignment','right');
e2=uicontrol('parent',h0,...
'style','edit',...
'string','3',...
'position',[20 150 60 20],...
'horizontalalignment','right');
t1=uicontrol('parent',h0,...
'style','text',...
'string','X from',...
'fontsize',10,...
'position',[20 230 60 20],...
'horizontalalignment','center');
t2=uicontrol('parent',h0,...
'style','text',...
'string','To',...
'fontsize',10,...
'position',[20 170 60 20],...
'horizontalalignment','center');
求解释下这个matlab程序 各种不懂啊!h0=figure('toolbar','none',...'position',[198 56 408 468],...'name','实例50');h1=axes('parent',h0,...'position',[0.29 0.45 0.7 0.5],...'visible','on');f=uicontrol('parent',h0,...'style','frame',...'pos
上述为一交互页面(窗口)的设计举例.
不能逐条给你解释,可能令你失望了.
对于这种例子,采用的都是格式化的语句与调用格式.建议你先执行,看到图形效果,很多东西自然明白.想仔细看懂每个的意思,除了借助Matlab Help外,你可以边修改边学习.如第一个语句有‘实例50’,你可以改成‘Whatever you want’,再对着看图形效果就应该Ok.