0001 function data = ltpda_xml_read_datasamples(node, dType)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 switch dType
0013 case 'real'
0014
0015 disp('-- reading real data samples');
0016
0017 data.x = [];
0018 data.y = [];
0019
0020 children = node.getChildNodes;
0021 for j=1:children.getLength
0022 ch = children.item(j-1);
0023 nodeName = char(ch.getNodeName);
0024 cont = char(ch.getTextContent);
0025 switch nodeName
0026 case 'xset'
0027 vals = sscanf(cont, '%g ');
0028 data.x = [data.x ; vals];
0029 disp(['* read ' num2str(length(data.x)) ' X samples']);
0030 case 'yset'
0031 vals = sscanf(cont, '%g ');
0032 data.y = [data.y ; vals];
0033 disp(['* read ' num2str(length(data.y)) ' Y samples']);
0034 otherwise
0035
0036 end
0037 end
0038
0039
0040
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 cont = char(ch.getTextContent);
0055 switch nodeName
0056 case 'xset'
0057 vals = sscanf(cont, '%f ');
0058 data.x = [data.x ; vals];
0059 disp(['* read ' num2str(length(data.x)) ' X samples']);
0060 case 'ryset'
0061 vals = sscanf(cont, '%f ');
0062 ry = [ry ; vals];
0063 disp(['* read ' num2str(length(ry)) ' real Y samples']);
0064 case 'iyset'
0065 vals = sscanf(cont, '%f ');
0066 iy = [iy ; vals];
0067 disp(['* read ' num2str(length(iy)) ' imag Y samples']);
0068 otherwise
0069
0070 end
0071 end
0072
0073
0074
0075
0076
0077 data.y = complex(ry, iy);
0078
0079 otherwise
0080 error('### unknown data type.');
0081 end
0082
0083
0084
0085