0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 function pzm = fromPolesAndZeros(pzm, pli)
0017
0018 VERSION = '$Id: fromPolesAndZeros.m,v 1.9 2008/09/04 13:37:14 ingo Exp $';
0019
0020
0021
0022 ii = pzmodel.getInfo('pzmodel', 'From Poles/Zeros');
0023
0024
0025 ii.setMversion([VERSION '-->' ii.mversion]);
0026
0027
0028 pl = combine(pli, ii.plists);
0029
0030
0031 pzm.gain = find(pl, 'gain');
0032 ps = find(pl, 'poles');
0033 zs = find(pl, 'zeros');
0034
0035
0036 if ~isa(ps, 'pz') && ~isempty(ps)
0037 ps = pz(ps);
0038 end
0039 if ~isa(zs, 'pz') && ~isempty(zs)
0040 zs = pz(zs);
0041 end
0042
0043
0044 pzm.poles = [];
0045 for kk = 1:length(ps)
0046 if ~isnan(ps(kk).f)
0047 pzm.poles = [pzm.poles ps(kk)];
0048 end
0049 end
0050
0051
0052 pzm.zeros = [];
0053 for kk = 1:length(zs)
0054 if ~isnan(zs(kk).f)
0055 pzm.zeros = [pzm.zeros zs(kk)];
0056 end
0057 end
0058
0059 name = find(pl, 'name');
0060 if ~isempty(name)
0061 pzm.name = name;
0062 end
0063
0064
0065 pzm.addHistory(ii, pl, [], []);
0066
0067 end