0001 function data = xml_read_datasamples(node, dType)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 switch dType
0016 case 'real'
0017
0018 disp('-- reading real data samples');
0019
0020 data.x = [];
0021 data.y = [];
0022
0023 children = node.getChildNodes;
0024 for j=1:children.getLength
0025 ch = children.item(j-1);
0026 nodeName = char(ch.getNodeName);
0027
0028 switch nodeName
0029 case 'XSet'
0030 vals = str2num(char(ch.getTextContent));
0031 data.x = [data.x vals];
0032 disp(['* read ' num2str(length(data.y)) ' X samples']);
0033 case 'YSet'
0034 vals = str2num(char(ch.getTextContent));
0035 data.y = [data.y vals];
0036 disp(['* read ' num2str(length(data.y)) ' Y samples']);
0037 otherwise
0038
0039 end
0040 end
0041
0042 case 'complex'
0043
0044 disp('-- reading complex data samples');
0045
0046 data.x = [];
0047 ry = [];
0048 iy = [];
0049
0050 children = node.getChildNodes;
0051 for j=1:children.getLength
0052 ch = children.item(j-1);
0053 nodeName = char(ch.getNodeName);
0054
0055 switch nodeName
0056 case 'XSet'
0057 vals = str2num(char(ch.getTextContent));
0058 data.x = [data.x vals];
0059 disp(['* read ' num2str(length(data.x)) ' X samples']);
0060 case 'rYSet'
0061 vals = str2num(char(ch.getTextContent));
0062 ry = [ry vals];
0063 disp(['* read ' num2str(length(ry)) ' real Y samples']);
0064 case 'iYSet'
0065 vals = str2num(char(ch.getTextContent));
0066 iy = [iy vals];
0067 disp(['* read ' num2str(length(iy)) ' imag Y samples']);
0068 otherwise
0069
0070 end
0071 end
0072
0073 data.y = complex(ry, iy);
0074
0075 otherwise
0076 error('### unknown data type.');
0077 end
0078
0079
0080
0081