calledit1.m

来自「北京航空航天大学出版社张志涌、徐彦琴主编的matlab教程附带的mfile例程压」· M 代码 · 共 17 行

M
17
字号
function calledit1( )
global hedit hpop hlist
ct=get(hedit,'string');				%获得输入的字符串函数					<2>
vpop=get(hpop,'value');				%获得选项的位置标识						<3>
vlist=get(hlist,'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   

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?