⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 disout.m

📁 一个利用元胞自动机进行生态仿真的matlab程序
💻 M
字号:
function y=disout(code,lnei,y)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DISOUT
% Display outer-totalistic rule code
% This function-M file is called by RGEN*** and RULEGEN2&3 
%
%	Fist Coded			19  August    1997
%	Last Modefied		23  April  1998
%
%	Copyright (c)
%	T. Suzudo JAERI-CAIL
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% y		: the vertical position of the strings
% code	: outer-totalistic rule-code defined in the program
% lnei	: number of neighbors
dy=0.05;
if nargin==2 y=4*dy; end
fig11=figure(11);
zerocode=bin2dec(code(1:lnei));
x=0;
uicontrol(fig11,'Style','text',...
	'String',['0-code: ' num2str(zerocode)],...
	'Units','normalized',...
	'position',[x,y,0.5,dy]);
onecode=bin2dec(code(lnei+1:2*lnei));
x=0.5;
uicontrol(fig11,'Style','text',...
	'String',['1-code: ' num2str(onecode)],...
	'Units','normalized',...
	'position',[x,y,0.5,dy]);

% Wolframs code
for ii=1:lnei
	tcode(2*ii)=code(lnei-ii+1);
	tcode(2*ii-1)=code(2*lnei-ii+1);
end
wolcode=bin2dec(tcode(1:2*lnei));
y=y-dy;
x=0.25;
uicontrol(fig11,'Style','text',...
	'String',['Wolfram-code: ' num2str(wolcode)],...
	'Units','normalized',...
	'position',[x,y,0.5,dy]);

⌨️ 快捷键说明

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