MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [求助]路过的请帮哥们儿的一个忙 (https://www.labfans.com/bbs/showthread.php?t=1418)

horse.wang 2008-02-21 10:08

[求助]路过的请帮哥们儿的一个忙
 
我在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.
请问这是怎么回事啊?

labfansyao 2008-02-27 19:02

试一下
 
里面linstyle应为linestyle
但是修改了之后还是不行,比较麻烦
实在不行的话,干脆把callback的内容建一个文件算了

smexxling 2008-03-24 21:32

困惑 困惑啊


所有时间均为北京时间。现在的时间是 04:54

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.