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

📄 tree2str.m

📁 The Source of Genetic Programming developed in Matlab
💻 M
字号:
function str=tree2str(tree)
%TREE2STR    Translates a GPLAB algorithm tree into a string.
%   TREE2STR(TREE) returns the string represented by the tree,
%   in valid Matlab notation, ready for evaluation.
%
%   Input arguments:
%      TREE - the tree to translate (struct)
%   Output arguments:
%      STRING - the string respresented by the tree (string)
%
%   See also MAKETREE
%
%   Copyright (C) 2003-2007 Sara Silva (sara@dei.uc.pt)
%   This file is part of the GPLAB Toolbox

str=tree.op;
args=[];
for k=1:length(tree.kids)
   args{k}=tree2str(tree.kids{k});
end
if ~isempty(args)
	str=strcat(str,'(',implode(args,','),')');
end

⌨️ 快捷键说明

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