comparison Problems/private/printf.m @ 10:207a6ae9a76f version1.0

(none)
author idamnjanovic
date Mon, 22 Mar 2010 15:06:25 +0000
parents
children
comparison
equal deleted inserted replaced
9:28f2b5fe3483 10:207a6ae9a76f
1 function str = printf(varargin)
2 %PRINTF Print formatted text to screen.
3 % PRINTF(FMT,VAL1,VAL2,...) formats the data in VAL1,VAL2,... according to
4 % the format string FMT, and prints the result to the screen.
5 %
6 % The call to PRINTF(FMT,VAL1,VAL2,...) simply invokes the call
7 % DISP(SPRINTF(FMT,VAL1,VAL2,...)). For a complete description of the
8 % format string options see function SPRINTF.
9 %
10 % STR = PRINTF(...) also returns the formatted string.
11
12
13 % Ron Rubinstein
14 % Computer Science Department
15 % Technion, Haifa 32000 Israel
16 % ronrubin@cs
17 %
18 % April 2008
19
20
21 if (nargout>0)
22 str = sprintf(varargin{:});
23 disp(str);
24 else
25 disp(sprintf(varargin{:}));
26 end