DISPLAY overloads display functionality for pzmodel objects. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: DISPLAY overloads display functionality for pzmodel objects. CALL: txt = display(pzmodel) INPUT: pzmodel - pole/zero model object OUTPUT: txt - cell array with strings to display the pole/zero model object VERSION: $Id: display.m,v 1.4 2007/10/15 17:16:56 ingo Exp $ HISTORY: 30-01-2007 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function txt = display(p) 0002 % DISPLAY overloads display functionality for pzmodel objects. 0003 % 0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0005 % 0006 % DESCRIPTION: DISPLAY overloads display functionality for pzmodel objects. 0007 % 0008 % CALL: txt = display(pzmodel) 0009 % 0010 % INPUT: pzmodel - pole/zero model object 0011 % 0012 % OUTPUT: txt - cell array with strings to display the pole/zero model object 0013 % 0014 % VERSION: $Id: display.m,v 1.4 2007/10/15 17:16:56 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('---- pzmodel %d ----', i); 0025 txt{end+1} = banner; 0026 0027 % get key and value 0028 name = get(p(i), 'name'); 0029 g = get(p(i), 'gain'); 0030 ps = get(p(i), 'poles'); 0031 zs = get(p(i), 'zeros'); 0032 np = length(ps); 0033 nz = length(zs); 0034 0035 % display 0036 txt{end+1} = ['model: ' name]; 0037 txt{end+1} = ['gain : ' num2str(g)]; 0038 for j=1:np 0039 txt{end+1} = [sprintf('pole %03d: ', j) char(ps(j)) ]; 0040 end 0041 for j=1:nz 0042 txt{end+1} = [sprintf('zero %03d: ', j) char(zs(j)) ]; 0043 end 0044 0045 banner_end(1:length(banner)) = '-'; 0046 txt{end+1} = banner_end; 0047 0048 end 0049 0050 if nargout == 0 0051 for ii=1:length(txt) 0052 disp(txt{ii}); 0053 end 0054 end 0055