matlab问题求助!!

clear;clchf=figure('Position',[200200600400],...'Name','Uicontrol1',...'NumberTitle',... clear;clc
hf=figure('Position',[200 200 600 400],...'Name','Uicontrol1',...'NumberTitle','off');
ha=axes('Position',[0.4 0.1 0.5 0.7],...'Box','on');
  hbSin=uicontrol(hf,...'style','pushbotton',...'Position',[50 140 100 30],...'String','Plot sin(x)',...'CallBack',...['subplot(ha);'...'x=0:0.1:4*pi;'...'plot(x,sin(x))'...'axis([0 4*pi -1 1]);'...'grid on;'...'xlable("x");'...'ylable("y=sin(x)");'...]);
调试后出现 ??? ha=axes('Position',[0.4 0.1 0.5 0.7],...'Box','on');
|
Error: The expression to the left of the equals sign is not a valid target for an assignment.
展开
 我来答
吾尝终日而思
2014-01-18 · TA获得超过1万个赞
知道大有可为答主
回答量:1276
采纳率:0%
帮助的人:808万
展开全部

你的代码里有几个错误,我帮你纠正了:

clear;clc

hf=figure('Position',[200 200 600 400],...

    'Name','Uicontrol1',...

    'NumberTitle','off');

ha=axes('Position',[0.4 0.1 0.5 0.7],...

        'Box','on');

hbSin=uicontrol(hf,...

    'Style','pushbutton',...

    'Position',[50 140 100 30],...

    'String','Plot sin(x)',...

    'CallBack',...

    ['subplot(ha);'...

    'x=0:0.1:4*pi;'...

    'plot(x,sin(x));'...

    'axis([0 4*pi -1 1]);'...

    'grid on;'...

    'xlabel(''x'');'...

    'ylabel(''y=sin(x)'');'...

    ]);

主要错误有:

1 注意断行,每个“...”之后都要重启一行;

2 pushbutton拼写错误

3 xlabel拼写错误;ylabel拼写错误;

4 xlabel和ylabel里面不是双引号,而是四组两个单引号。

执行结果



已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式