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 end
0029
0030
0031
0032 pn = get(h, 'n');
0033
0034
0035 ihs = get(h, 'inhists');
0036
0037
0038 if isa(ihs, 'history')
0039 for i=1:length(ihs)
0040
0041 nn = get(ihs(i), 'n');
0042
0043 if nn < 0
0044
0045 a = a + 1;
0046 [n,a, nodes] = getNodes(ihs(i), n, pn, a, nodes);
0047 else
0048 [n,a, nodes] = getNodes(h, n, get(h,'pn'), a, nodes);
0049 end
0050 end
0051 end
0052