0001 function [n,a,nodes] = getNodes(h, n, pn, a, nodes)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 nn = get(h,'n');
0013 if nn<0
0014 h = set(h, 'n', a);
0015 end
0016
0017
0018 nn = get(h,'pn');
0019 if nn<0
0020 h = set(h, 'pn', pn);
0021 n = [n pn];
0022 nodes(a).pn = pn;
0023 nodes(a).invars = get(h, 'invars');
0024 nodes(a).n = get(h, 'n');
0025 nodes(a).names = get(h, 'name');
0026 nodes(a).params = char(get(h, 'plist'));
0027 nodes(a).pl = get(h, 'plist');
0028 nodes(a).h = h;
0029 end
0030
0031
0032
0033 pn = get(h, 'n');
0034
0035
0036 ihs = get(h, 'inhists');
0037
0038
0039 if isa(ihs, 'history')
0040 for i=1:length(ihs)
0041
0042 nn = get(ihs(i), 'n');
0043
0044 if nn < 0
0045
0046 a = a + 1;
0047 [n,a, nodes] = getNodes(ihs(i), n, pn, a, nodes);
0048 else
0049 [n,a, nodes] = getNodes(h, n, get(h,'pn'), a, nodes);
0050 end
0051 end
0052 end
0053