0001 function txt = display(hists)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 txt = {};
0022
0023 for i=1:length(hists)
0024 h = hists(i);
0025 banner = sprintf('-------- %s / %s / %d ------------', get(h, 'name'), get(h, 'version'), get(h, 'n'));
0026 txt{end+1} = banner;
0027
0028 txt{end+1} = ' ';
0029 txt{end+1} = sprintf('created: %s', char(h.created));
0030
0031
0032 txt{end+1} = ['Inputs: ' get(h, 'invars')];
0033
0034
0035 txt{end+1} = 'Parameters';
0036 txt{end+1} = '----------';
0037 plist = get(h, 'plist');
0038 if ~isempty(plist)
0039 txt{end+1} = display(plist);
0040 end
0041
0042 txt{end+1} = ' ';
0043
0044 txt{end+1} = 'Histories';
0045 txt{end+1} = '---------';
0046
0047
0048 inhists = get(h, 'inhists');
0049 nhists = length(inhists);
0050 txt{end+1} = sprintf('n input histories: %d', nhists);
0051 if nhists > 0
0052 txt{end+1} = display(inhists);
0053 end
0054
0055 txt{end+1} = ' ';
0056
0057 bannerEnd = [];
0058 while length(bannerEnd) < length(banner)
0059 bannerEnd = [bannerEnd '-'];
0060 end
0061 txt{end+1} = bannerEnd;
0062
0063 txt{end+1} = ' ';
0064 txt{end+1} = ' ';
0065 end
0066
0067 txt = single_cell(txt);
0068
0069 if nargout == 0
0070 for ii=1:length(txt)
0071 disp(txt{ii});
0072 end
0073 end
0074
0075
0076
0077 function new_txt = single_cell(txt_field)
0078
0079 new_txt = {};
0080 for ii=1:length(txt_field)
0081 if iscell(txt_field{ii})
0082 hh = single_cell(txt_field{ii});
0083 new_txt(end+1:end+length(hh)) = hh(1:end);
0084 else
0085 new_txt{end+1} = txt_field{ii};
0086 end
0087 end
0088
0089