Mercurial > hg > ltpda
diff m-toolbox/classes/@history/display.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/classes/@history/display.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,47 @@ +% DISPLAY implement terminal display for history object. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% DESCRIPTION: DISPLAY implement terminal display for history object. +% +% CALL: txt = display(history) +% +% INPUT: history - history object +% +% OUTPUT: txt - cell array with strings to display the history object +% +% VERSION: $Id: display.m,v 1.19 2011/02/18 16:48:52 ingo Exp $ +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function varargout = display(varargin) + + hists = [varargin{:}]; + + txt = utils.helper.objdisp(hists); + + if nargout == 0 + for ii=1:length(txt) + disp(txt{ii}); + end + end + + varargout{1} = txt; +end + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Local Functions % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function new_txt = single_cell(txt_field) + + new_txt = {}; + for ii=1:length(txt_field) + if iscell(txt_field{ii}) + hh = single_cell(txt_field{ii}); + new_txt(end+1:end+length(hh)) = hh(1:end); + else + new_txt{end+1} = txt_field{ii}; + end + end +end +