0001 function txt = display(tt)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 txt = {};
0022
0023 tt = reshape(tt, numel(tt), 1);
0024
0025 for ii = 1:length(tt)
0026 t = tt(ii);
0027
0028 b_banner = sprintf('---------- timeformat %02d ----------', ii);
0029 txt{end+1} = b_banner;
0030 txt{end+1} = ' ';
0031
0032 fields = fieldnames(t);
0033 max_length = length(fields{1});
0034 for jj = 2:length(fields)
0035 if length(fields{jj}) > max_length
0036 max_length = length(fields{jj});
0037 end
0038 end
0039
0040 for jj = 1:length(fields)
0041 field = fields{jj};
0042
0043 str_field = [];
0044 str_field(1:max_length-length(field)) = ' ';
0045 str_field = [field str_field];
0046
0047
0048 if isnumeric(t.(field))
0049 txt{end+1} = sprintf ('%s: %s',str_field, num2str(t.(field)));
0050
0051
0052 elseif ischar(t.(field))
0053 txt{end+1} = sprintf ('%s: %s',str_field, t.(field));
0054
0055
0056 elseif islogical(t.(field))
0057 if t.(field) == true
0058 txt{end+1} = sprintf ('%s: true',str_field);
0059 else
0060 txt{end+1} = sprintf ('%s: false',str_field);
0061 end
0062
0063
0064 elseif isobject(t.(field))
0065 txt{end+1} = sprintf ('%s: %s class',str_field, class(t.(field)));
0066
0067
0068 elseif isjava(t.(field))
0069 error ('### Unknown java class %s', class(t.(field)))
0070
0071 else
0072 error ('### Please define the output for this property %s', field)
0073 end
0074
0075 end
0076
0077
0078 e_banner(1:length(b_banner)) = '-';
0079 txt{end+1} = e_banner;
0080
0081 txt{end+1} = ' ';
0082 txt{end+1} = ' ';
0083
0084 end
0085
0086 if nargout == 0
0087 for ii=1:length(txt)
0088 disp(txt{ii});
0089 end
0090 end
0091
0092