view m-toolbox/classes/@pz/setRI.m @ 52:daf4eab1a51e
database-connection-manager tip
Fix. Default password should be [] not an empty string
author
Daniele Nicolodi <nicolodi@science.unitn.it>
date
Wed, 07 Dec 2011 17:29:47 +0100 (2011-12-07)
parents
f0afece42f48
children
line source
+ − % 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.2 2011/02/18 16:48:54 ingo Exp $
+ − %
+ − %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ −
+ − function ii = setRI(ii, val)
+ −
+ − %%% decide whether we modify the pz-object, or create a new one.
+ − ii = copy(ii, nargout);
+ −
+ − if numel(val) == 1
+ − % add conjugate
+ − val = [val conj(val)];
+ − elseif numel(val) == 2
+ − if val(1) ~= conj(val(2))
+ − error('### Please enter a conjugate pair to specify a complex pole.');
+ − end
+ − else
+ − error('### A pole/zero must be defined with a conjugate pair or a single complex number');
+ − end
+ −
+ − %%% set 'ri'
+ − ii.ri = val;
+ − %%% Then compute and set f and Q
+ − [f,q] = pz.ri2fq(ii.ri);
+ − ii.f = f;
+ − ii.q = q;
+ − end