📄 tabofasc.m
字号:
function tab = tabofasc(nodes,order,level)
%TABOFASC Table of ascendants of nodes.
% TAB = TABOFASC(NODES,ORDER,LEVEL)
% M. Misiti, Y. Misiti, G. Oppenheim, J.M. Poggi 01-Oct-96.
% Last Revision: 16-Jul-1998.
% Copyright 1995-2002 The MathWorks, Inc.
% $Revision: 1.4 $ $Date: 2002/04/14 19:34:01 $
tab = zeros(length(nodes),level+1);
tab(:,1) = nodes;
for j = 1:level
tab(:,j+1) = floor((tab(:,j)-1)/order);
end
%----------------------------------------%
% If index(n) = j , then
% index(parent(n)) = floor((j-1)/order)
%
% example: order = 2
%
% 7 7 3 1 0 -1
% 17 17 8 3 1 0
% tn = 18 ==> 18 8 3 1 0
% 4 4 1 0 -1 -1
% 2 2 0 -1 -1 -1
%------------------------------------------%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -