wangbiao 发表于 2006-10-24 15:05

初学者问个问题

Error: Missing variable or function.

??? Error :while evaluating uimenu Callback.

在使用callback属性时,,就出现这样的错误,,这是为什么啊??

jimin 发表于 2006-10-24 15:16

给程序吧

wangbiao 发表于 2006-10-24 15:24

popcol=uicontrol(gcf,'Style','popup',...
    'String','red|blue|green|yellow',...
    'Position',,...
    'CallBack',['cbcol=["R","B","G","Y"];',...
    'set(gcf,"Color",cbcol(get(popcol,"Vaule")))']);

happy 发表于 2006-10-24 17:34

popcol=uicontrol(gcf,'Style','popup',...
    'String','red|blue|green|yellow',...
    'Position',);
set(popcol,'CallBack','callpopup(popcol)');

function callpopup(popcol)
cbcol=['R','B','G','Y'];
set(gcf,'Color',cbcol(get(popcol,'value')))

wangbiao 发表于 2006-10-25 16:29

运行之后还是不行咯

??? Undefined command/function 'callpopup'.

??? Error while evaluating uicontrol Callback.

jimin 发表于 2006-10-25 16:33

代码没问题的

jimin 发表于 2006-10-25 16:35

将第二个保存为callpopup
在命令窗口输入第一个
应该没问题的

wangbiao 发表于 2006-10-26 17:11

可以了,,多谢,
页: [1]
查看完整版本: 初学者问个问题