SETQ Set the property 'q' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: SETQ Set the property 'q' and computes 'ri' CALL: obj = obj.setQ(1); obj = setQ(obj, 1); INPUTS: obj - is a pz object VERSION: $Id: setQ.m,v 1.1 2008/07/11 17:34:47 ingo Exp $ HISTORY: 27-05-2008 Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % SETQ Set the property 'q' 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: SETQ Set the property 'q' and computes 'ri' 0005 % 0006 % CALL: obj = obj.setQ(1); 0007 % obj = setQ(obj, 1); 0008 % 0009 % INPUTS: obj - is a pz object 0010 % 0011 % VERSION: $Id: setQ.m,v 1.1 2008/07/11 17:34:47 ingo Exp $ 0012 % 0013 % HISTORY: 27-05-2008 Hewitson 0014 % Creation 0015 % 0016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0017 0018 function ii = setQ(ii, val) 0019 0020 %%% decide whether we modify the pz-object, or create a new one. 0021 ii = copy(ii, nargout); 0022 0023 %%% set 'q' 0024 ii.q = val; 0025 %%% Then compute and set ri 0026 ii.ri = pz.fq2ri(ii.f, ii.q); 0027 0028 %%% did we split to two real poles? 0029 if ii.q < 0.5 0030 ri = ii.ri; 0031 ii.ri = ri(1); 0032 ii(2).f = ii.f; 0033 ii(2).q = NaN; 0034 ii(2).ri = ri(1); 0035 end 0036 end