Home > classes > @pz > setRI.m

setRI

PURPOSE ^

SETRI Set the property 'ri' and computes 'f' and 'q'

SYNOPSIS ^

function ii = setRI(ii, val)

DESCRIPTION ^

 SETRI Set the property 'ri' and computes 'f' and 'q'
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: SETRI Set the property 'ri' and computes 'f' and 'q'

 CALL:        obj = obj.setRI(val);
              obj = setRI(obj, val);

 INPUTS:      obj - is a pz object

 VERSION:     $Id: setRI.m,v 1.1 2008/07/11 17:34:47 ingo Exp $

 HISTORY:     27-05-2008 Hewitson
                 Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % SETRI Set the property 'ri' and computes 'f' and 'q'
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION: SETRI Set the property 'ri' and computes 'f' and 'q'
0005 %
0006 % CALL:        obj = obj.setRI(val);
0007 %              obj = setRI(obj, val);
0008 %
0009 % INPUTS:      obj - is a pz object
0010 %
0011 % VERSION:     $Id: setRI.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 = setRI(ii, val)
0019 
0020   %%% decide whether we modify the pz-object, or create a new one.
0021   ii = copy(ii, nargout);
0022 
0023   if numel(val) == 1
0024     % add conjugate
0025     val = [val conj(val)];
0026   elseif numel(val) == 2
0027     if val(1) ~= conj(val(2))
0028       error('### Please enter a conjugate pair to specify a complex pole.');
0029     end
0030   else
0031     error('### A pole/zero must be defined with a conjugate pair or a single complex number');
0032   end
0033 
0034   %%% set 'ri'
0035   ii.ri = val;
0036   %%% Then compute and set f and Q
0037   [f,q] = pz.ri2fq(ii.ri);
0038   ii.f = f;
0039   ii.q = q;
0040 end

Generated on Mon 08-Sep-2008 13:18:47 by m2html © 2003