Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
|
![]() |
#1 |
初级会员
注册日期: 2008-01-22
年龄: 43
帖子: 4
声望力: 0 ![]() |
![]()
我在matlab命令窗口输入以下程序
fig=figure('position',[400 300 350 300],'name','radio button 范例','menubar','none'); axes('position',[0.35 0.15 0.6 0.75]); x=linspace(0,2*pi); y=sin(x); p=plot(x,y); radio_h(1)=uicontrol(fig,'style','radio','position',[15 200 80 30],'string','square','callback',['if get(gcbo,"value")==1;','set(radio_h(radio_h~=gcbo),"value",0);','end;','set(p,"linstyle","s");']); 目的是绘制一个正弦函数图出来之后,能够用radio button控制它的图线的形式为square,但是当我点击radio button 时出现了下面的报警, Error: The input character is not valid in MATLAB statements or expressions. Error while evaluating uicontrol Callback. 请问这是怎么回事啊? |
![]() |
![]() |
![]() |
#2 |
初级会员
注册日期: 2008-02-26
年龄: 34
帖子: 9
声望力: 0 ![]() |
![]()
里面linstyle应为linestyle
但是修改了之后还是不行,比较麻烦 实在不行的话,干脆把callback的内容建一个文件算了 |
![]() |
![]() |
![]() |
#3 |
初级会员
注册日期: 2008-03-21
年龄: 39
帖子: 7
声望力: 0 ![]() |
![]()
困惑 困惑啊
|
![]() |
![]() |