diff m-toolbox/classes/+utils/@prog/disp.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/+utils/@prog/disp.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,24 @@
+function varargout = disp(varargin)
+
+% DISP display a formatted string to screen.
+% 
+% usage:     disp(format, args);
+%        s = disp(format, args);
+% 
+% Examples:
+%      >> disp('%s-%d', 'hello', 3);
+%      >> s = disp('%s-%d', 'hello', 3);
+% 
+% M Hewitson 26-02-08
+% 
+% $Id: disp.m,v 1.1 2008/06/18 13:35:11 hewitson Exp $
+
+% so simple
+s = sprintf(varargin{1}, varargin{2:end});
+disp(s);
+
+if nargout == 1
+  varargout{1} = s;
+end
+
+% END
\ No newline at end of file