Mercurial > hg > ltpda
comparison m-toolbox/classes/@stattest/attachToDom.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 | |
2 function collectedHist = attachToDom(objs, dom, parent, collectedHist) | |
3 | |
4 if isempty(objs) | |
5 | |
6 % Create empty stattest node with the attribute 'shape' | |
7 utils.xml.attachEmptyObjectNode(objs, dom, parent); | |
8 | |
9 else | |
10 for oo = 1:numel(objs) | |
11 obj = objs(oo); | |
12 | |
13 % Create object node | |
14 stNode = dom.createElement('stattest'); | |
15 stNode.setAttribute('shape', sprintf('%dx%d', size(objs))); | |
16 | |
17 % Call superclass | |
18 collectedHist = attachToDom@ltpda_uoh(obj, dom, stNode, collectedHist); | |
19 | |
20 % Add data | |
21 if ~isempty(obj.data) | |
22 dataNode = dom.createElement('data'); | |
23 collectedHist = utils.xml.attachCellToDom(obj.data, dom, dataNode, collectedHist); | |
24 stNode.appendChild(dataNode); | |
25 end | |
26 | |
27 % Add pvalue | |
28 if ~isempty(obj.pvalue) | |
29 pvalueNode = dom.createElement('pvalue'); | |
30 utils.xml.attachNumberToDom(obj.pvalue, dom, pvalueNode); | |
31 stNode.appendChild(pvalueNode); | |
32 end | |
33 | |
34 % Add result | |
35 resNode = dom.createElement('result'); | |
36 utils.xml.attachNumberToDom(double(obj.result), dom, resNode); | |
37 stNode.appendChild(resNode); | |
38 | |
39 % Add to parent node | |
40 parent.appendChild(stNode); | |
41 | |
42 end | |
43 end | |
44 | |
45 end |