Mercurial > hg > smallbox
annotate DL/RLS-DLA/private/printf.m @ 65:55faa9b5d1ac
(none)
author | idamnjanovic |
---|---|
date | Wed, 16 Mar 2011 13:41:02 +0000 |
parents | ad36f80e2ccf |
children |
rev | line source |
---|---|
idamnjanovic@60 | 1 function str = printf(varargin) |
idamnjanovic@60 | 2 %PRINTF Print formatted text to screen. |
idamnjanovic@60 | 3 % PRINTF(FMT,VAL1,VAL2,...) formats the data in VAL1,VAL2,... according to |
idamnjanovic@60 | 4 % the format string FMT, and prints the result to the screen. |
idamnjanovic@60 | 5 % |
idamnjanovic@60 | 6 % The call to PRINTF(FMT,VAL1,VAL2,...) simply invokes the call |
idamnjanovic@60 | 7 % DISP(SPRINTF(FMT,VAL1,VAL2,...)). For a complete description of the |
idamnjanovic@60 | 8 % format string options see function SPRINTF. |
idamnjanovic@60 | 9 % |
idamnjanovic@60 | 10 % STR = PRINTF(...) also returns the formatted string. |
idamnjanovic@60 | 11 |
idamnjanovic@60 | 12 |
idamnjanovic@60 | 13 % Ron Rubinstein |
idamnjanovic@60 | 14 % Computer Science Department |
idamnjanovic@60 | 15 % Technion, Haifa 32000 Israel |
idamnjanovic@60 | 16 % ronrubin@cs |
idamnjanovic@60 | 17 % |
idamnjanovic@60 | 18 % April 2008 |
idamnjanovic@60 | 19 |
idamnjanovic@60 | 20 |
idamnjanovic@60 | 21 if (nargout>0) |
idamnjanovic@60 | 22 str = sprintf(varargin{:}); |
idamnjanovic@60 | 23 disp(str); |
idamnjanovic@60 | 24 else |
idamnjanovic@60 | 25 disp(sprintf(varargin{:})); |
idamnjanovic@60 | 26 end |