|
列表框和“Apply”按键配合的回调函数Myapply.m
[Myapply.m]
function Myapply
vlist=get(findobj(gcf,'Tag','Listbox1'),'value'); %获得选项位置向量
liststr={'grid on','box on','hidden off','axis off'}; %列表框选项内容
invstr={'grid off','box off','hidden on','axis on'}; %列表框的逆指令
vv=zeros(1,4);vv(vlist)=1;
for k=1:4
if vv(k);eval(liststr{k});else eval(invstr{k});end %按列表选项影响图形
end
(3)动态编辑框的回调函数Myedit.m
[Myedit.m]
function Myedit
ct=get(findobj(gcf,'Tag','EditText1'),'string');
eval(ct')

Powered by Discuz! X2.5 © 2001-2013 数学建模网-数学中国 ( 蒙ICP备14002410号-3 蒙BBS备-0002号 ) 论坛法律顾问:王兆丰
GMT+8, 2025-11-6 07:05 , Processed in 0.468043 second(s), 27 queries .