comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 function varargout = disp(varargin)
2
3 % DISP display a formatted string to screen.
4 %
5 % usage: disp(format, args);
6 % s = disp(format, args);
7 %
8 % Examples:
9 % >> disp('%s-%d', 'hello', 3);
10 % >> s = disp('%s-%d', 'hello', 3);
11 %
12 % M Hewitson 26-02-08
13 %
14 % $Id: disp.m,v 1.1 2008/06/18 13:35:11 hewitson Exp $
15
16 % so simple
17 s = sprintf(varargin{1}, varargin{2:end});
18 disp(s);
19
20 if nargout == 1
21 varargout{1} = s;
22 end
23
24 % END