ivan@140: function str = printf(varargin) ivan@140: %PRINTF Print formatted text to screen. ivan@140: % PRINTF(FMT,VAL1,VAL2,...) formats the data in VAL1,VAL2,... according to ivan@140: % the format string FMT, and prints the result to the screen. ivan@140: % ivan@140: % The call to PRINTF(FMT,VAL1,VAL2,...) simply invokes the call ivan@140: % DISP(SPRINTF(FMT,VAL1,VAL2,...)). For a complete description of the ivan@140: % format string options see function SPRINTF. ivan@140: % ivan@140: % STR = PRINTF(...) also returns the formatted string. ivan@140: ivan@140: ivan@140: % Ron Rubinstein ivan@140: % Computer Science Department ivan@140: % Technion, Haifa 32000 Israel ivan@140: % ronrubin@cs ivan@140: % ivan@140: % April 2008 ivan@140: ivan@140: ivan@140: if (nargout>0) ivan@140: str = sprintf(varargin{:}); ivan@140: disp(str); ivan@140: else ivan@140: disp(sprintf(varargin{:})); ivan@140: end