www.pudn.com > matlab8.zip > calledit2.m


function calledit2( ) 
H=get(gcf,'UserData'); 
ct=get(H(1),'string');				%获得输入的字符串函数					<2> 
vpop=get(H(2),'value');				%获得选项的位置标识						<3> 
vlist=get(H(3),'value');			%获得选项位置向量							<4> 
 
if ~isempty(ct)						%可编辑框输入非空时						<5> 
   eval(ct')							%运行从编辑文本框送入的指令				<6>	 
   popstr={'spring','summer','autumn','winter'};		%弹出框色图矩阵	<7> 
   liststr={'grid on','box on','hidden off','axis off'};%列表框选项内容	<8>	 
   invstr={'grid off','box off','hidden on','axis on'};%列表框的逆指令	<9> 
   colormap(eval(popstr{vpop}))		%采用弹出框所选色图					<10> 
   vv=zeros(1,4);vv(vlist)=1;		 
   for k=1:4 
      if vv(k);eval(liststr{k});else eval(invstr{k});end %按列表选项影响图形 
   end 
end