Mercurial > hg > smallbox
annotate util/ksvd utils/printf.m @ 247:ecce33192fcc tip
Added tag ver_2.1 for changeset cef4500b936f
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Wed, 31 Oct 2012 12:24:44 +0000 |
parents | c3eca463202d |
children |
rev | line source |
---|---|
idamnjanovic@70 | 1 function str = printf(varargin) |
idamnjanovic@70 | 2 %PRINTF Print formatted text to screen. |
idamnjanovic@70 | 3 % PRINTF(FMT,VAL1,VAL2,...) formats the data in VAL1,VAL2,... according to |
idamnjanovic@70 | 4 % the format string FMT, and prints the result to the screen. |
idamnjanovic@70 | 5 % |
idamnjanovic@70 | 6 % The call to PRINTF(FMT,VAL1,VAL2,...) simply invokes the call |
idamnjanovic@70 | 7 % DISP(SPRINTF(FMT,VAL1,VAL2,...)). For a complete description of the |
idamnjanovic@70 | 8 % format string options see function SPRINTF. |
idamnjanovic@70 | 9 % |
idamnjanovic@70 | 10 % STR = PRINTF(...) also returns the formatted string. |
idamnjanovic@70 | 11 |
idamnjanovic@70 | 12 |
idamnjanovic@70 | 13 % Ron Rubinstein |
idamnjanovic@70 | 14 % Computer Science Department |
idamnjanovic@70 | 15 % Technion, Haifa 32000 Israel |
idamnjanovic@70 | 16 % ronrubin@cs |
idamnjanovic@70 | 17 % |
idamnjanovic@70 | 18 % April 2008 |
idamnjanovic@70 | 19 |
idamnjanovic@70 | 20 |
idamnjanovic@70 | 21 if (nargout>0) |
idamnjanovic@70 | 22 str = sprintf(varargin{:}); |
idamnjanovic@70 | 23 disp(str); |
idamnjanovic@70 | 24 else |
idamnjanovic@70 | 25 disp(sprintf(varargin{:})); |
idamnjanovic@70 | 26 end |