如何在popupmenu下的不同选项中调用不同的图像
<P>请教:<br>如何在popupmenu下的不同选项中调用不同的图像??</P>[此贴子已经被suffer于2006-5-18 11:09:37编辑过]
回复:(zbf)如何在popupmenu下的不同选项中调用不同...
<P>通过callback设置调用不同的图片文件</P>这样写哪错了???
clf reset % <1><br>set(gcf,'unit','normalized','position',);%<br>set(gcf,'defaultuicontrolunits','normalized');<br>set(gcf,'defaultuicontrolfontsize',11);<br>set(gcf,'defaultuicontrolfontname','隶书');<br>set(gcf,'defaultuicontrolhorizontal','left');<br> %<br>str='Data reconciliation';<br>set(gcf,'name',str,'numbertitle','off'); <br>hpop=uicontrol(gcf,'style','popup',... %<17><br> 'position',,...<br> 'string','图1|图2');% <br>set(hpop,'callback','Mycolormap(hpop)'); %<27><br><br>function Mycolormap(hpop)<br>global hpop<br>popstr={'图1','图2'};%弹出框色图矩阵<br>vpop=get(findobj(gcf,'Tag','PopupMenu1'),'value'); %获得选项的位置标识<br>h1(eval(popstr{vpop})) %采用弹出框所选色图<br>function h1(vpop)<br>switch vpop<br> case '图1',set(hpop,'callback','tu1');<br> otherwise '图2', set(hpop,'callback','tu2');<br>end<br><br>Function 'eval' is not defined for values of class 'double'.<br>Error while evaluating uicontrol Callback.<br>怎么改呀?[此贴子已经被作者于2006-5-18 11:58:05编辑过]
页:
[1]