DISPLAY overloads display functionality for pole objects. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: DISPLAY overloads display functionality for pole objects. CALL: txt = display(pole) INPUT: pole - pole object OUTPUT: txt - cell array with strings to display the pole object VERSION: $Id: display.m,v 1.3 2007/09/12 14:01:38 ingo Exp $ HISTORY: 30-01-2007 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function txt = display(p) 0002 % DISPLAY overloads display functionality for pole objects. 0003 % 0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0005 % 0006 % DESCRIPTION: DISPLAY overloads display functionality for pole objects. 0007 % 0008 % CALL: txt = display(pole) 0009 % 0010 % INPUT: pole - pole object 0011 % 0012 % OUTPUT: txt - cell array with strings to display the pole 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_start = sprintf('---- pole %d ----', i); 0025 txt{end+1} = banner_start; 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_start)) = '-'; 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