dissym.m

来自「一个利用元胞自动机进行生态仿真的matlab程序」· M 代码 · 共 41 行

M
41
字号
function y=dissym(code,lnei)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DISSYM
% Display symmetric rule code
%
% called by RULEGEN2 
%
%	Fist Coded			20  March    1998
%	Last Modefied		20  March    1998
%
%	Copyright (c)
%	T. Suzudo JAERI-CAIL
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% y		: the vertical position of the strings
% code	: symmetric rule-code defined in the program
% lnei	: number of neighbors
fig11=figure(11);
dy=0.05;

if lnei==5
	zerocode=bin2dec(code(1:6));
else
	error('Invalid neighbor');
end
x=0;
y=4*dy;
uicontrol(fig11,'Style','text',...
	'String',['0-code: ' num2str(zerocode)],...
	'Units','normalized',...
	'position',[x,y,0.5,dy]);
if lnei==5 
	onecode=bin2dec(code(7:12));
else
	error('Invalid neighbor');
end

x=0.5;
uicontrol(fig11,'Style','text',...
	'String',['1-code: ' num2str(onecode)],...
	'Units','normalized',...
	'position',[x,y,0.5,dy]);

⌨️ 快捷键说明

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