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