0001 function po = fromxml(xml)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 p.name = '';
0017 p.poles = [];
0018 p.zeros = [];
0019 p.gain = 0;
0020 p.created = '';
0021 p.version = '';
0022
0023 sch = xml.getChildNodes;
0024 for c=1:sch.getLength
0025 x = sch.item(c-1);
0026 switch char(x.getNodeName)
0027 case 'name'
0028 p.name = char(x.getTextContent);
0029 case 'gain'
0030 p.gain = str2num(char(x.getTextContent));
0031 case 'poles'
0032 p.poles = [];
0033 xch = x.getChildNodes;
0034 for j=1:xch.getLength
0035 it = xch.item(j-1);
0036 if strcmp(char(it.getNodeName), 'pole')
0037 p.poles = [p.poles pole(it)];
0038 end
0039 end
0040 case 'zeros'
0041 p.zeros = [];
0042 xch = x.getChildNodes;
0043 for j=1:xch.getLength
0044 it = xch.item(j-1);
0045 if strcmp(char(it.getNodeName), 'zero')
0046 p.zeros = [p.zeros zero(it)];
0047 end
0048 end
0049 case 'created'
0050 xch = x.getChildNodes;
0051 p.created = time(xch.item(1));
0052 case 'version'
0053 p.version = char(x.getTextContent);
0054 otherwise
0055 end
0056 end
0057
0058
0059 po = pzmodel(p);
0060
0061