Home > classes > @zero > display.m

display

PURPOSE ^

DISPLAY overloads display functionality for zero objects.

SYNOPSIS ^

function txt = display(p)

DESCRIPTION ^

 DISPLAY overloads display functionality for zero objects.

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

 DESCRIPTION: DISPLAY overloads display functionality for zero objects.

 CALL:        txt  = display(zero)

 INPUT:       zero - zero object

 OUTPUT:      txt  - cell array with strings to display the zero object

 VERSION:     $Id: display.m,v 1.3 2007/09/12 14:01:38 ingo Exp $

 HISTORY:     30-01-2007 M Hewitson
                 Creation

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function txt = display(p)
0002 % DISPLAY overloads display functionality for zero objects.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: DISPLAY overloads display functionality for zero objects.
0007 %
0008 % CALL:        txt  = display(zero)
0009 %
0010 % INPUT:       zero - zero object
0011 %
0012 % OUTPUT:      txt  - cell array with strings to display the zero object
0013 %
0014 % VERSION:     $Id: display.m,v 1.3 2007/09/12 14:01:38 ingo Exp $
0015 %
0016 % HISTORY:     30-01-2007 M Hewitson
0017 %                 Creation
0018 %
0019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0020 
0021 txt = {};
0022 
0023 for i=1:length(p)
0024   banner = sprintf('---- zero %d ----', i);
0025   txt{end+1} = banner;
0026 
0027   % get key and value
0028   name = get(p(i), 'name');
0029   f    = get(p(i), 'f');
0030   q    = get(p(i), 'q');
0031   ri   = get(p(i), 'ri');
0032 
0033   % display
0034   if ~isempty(f)
0035     if q > 0.5
0036       txt{end+1} = [ sprintf('%s: %g Hz, Q=%g [', name, f, q) num2str(ri(1)) ']'];
0037     else
0038       txt{end+1} = sprintf('%s: %g Hz', name, f);
0039     end
0040   end
0041 
0042   banner_end(1:length(banner)) = '-';
0043   txt{end+1} = banner_end;
0044 
0045 end
0046 
0047 if nargout == 0
0048   for ii=1:length(txt)
0049     disp(txt{ii});
0050   end
0051 end
0052 
0053

Generated on Thu 01-Nov-2007 09:42:34 by m2html © 2003