diff m-toolbox/classes/@cdata/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/@cdata/display.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,38 @@
+% DISPLAY implement terminal display for cdata object.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% DESCRIPTION: DISPLAY implement terminal display for cdata object.
+%
+% VERSION:     $Id: display.m,v 1.19 2011/02/18 16:48:51 ingo Exp $
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+function varargout = display(varargin)
+
+  cdatas = [varargin{:}];
+
+  txt = {};
+
+  for i=1:numel(cdatas)
+    banner = sprintf('-------- cdata %02d ------------', i);
+    txt{end+1} = banner;
+
+    txt{end+1} = sprintf('     y:  [%dx%d], %s', size(cdatas(i).y), class(cdatas(i).y));
+    txt{end+1} = sprintf('    dy:  [%dx%d], %s', size(cdatas(i).dy), class(cdatas(i).y));
+    txt{end+1} = sprintf('yunits:  %s', char(cdatas(i).yunits));
+
+    banner_end(1:length(banner)) = '-';
+    txt{end+1} = banner_end;
+
+    txt{end+1} = ' ';
+  end
+
+  if nargout == 0
+    for ii=1:length(txt)
+      disp(txt{ii});
+    end
+  end
+
+  varargout{1} = txt;
+end
+