comparison m-toolbox/classes/@pz/char.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % CHAR convert a pz object into a string.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: CHAR convert a pz object into a string.
5 %
6 % CALL: string = char(obj)
7 %
8 % VERSION: $Id: char.m,v 1.9 2011/02/18 16:48:54 ingo Exp $
9 %
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12 function varargout = char(varargin)
13
14 objs = utils.helper.collect_objects(varargin(:), 'pz');
15
16 pstr = '';
17 for ii = 1:numel(objs)
18 pp = objs(ii);
19 % f and Q
20 pstr = [pstr sprintf('(f=%g Hz, Q=%g, ri=%s), ', pp.f, pp.q, mat2str(pp.ri(1), 4))];
21 end
22
23 %%% Prepare output
24 varargout{1} = pstr(1:end-2);
25 end
26