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