findparent.m

来自「利用电磁场的源激发方法来计算光子晶体波导例如光子晶体光纤」· M 代码 · 共 17 行

M
17
字号
function nodeOut = findParent(nodeRoot, nodeIn)
if ~is_first_in_second(nodeIn.curve, nodeRoot.curve)
    nodeOut = 0;
    return
end
if isempty(nodeRoot.children)
    nodeOut = nodeRoot;
    return
end
for iChild = 1:length(nodeRoot.children)
    children = nodeRoot.children;
    nodeOut = findParent(children(iChild), nodeIn);
    if nodeOut ~= 0
        return
    end
end
nodeOut = nodeRoot;

⌨️ 快捷键说明

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