You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: num2str.m
    path of file: ./repos/spm/matlabbatch/private
    
    the code of the file until where you have to start completion: function s = num2str(x, f)
%NUM2STR Convert numbers to a string.
%   T = NUM2STR(X) converts the matrix X into a string representation T
%   with about 4 digits and an exponent if required.  This is useful for
%   labeling plots with the TITLE, XLABEL, YLABEL, and TEXT commands.
%
%   T = NUM2STR(X,N) converts the matrix X into a string representation
%   with a maximum N digits of precision.  The default number of digits is
%   based on the magnitude of the elements of X.
%
%   T = NUM2STR(X,FORMAT) uses the format string FORMAT (see SPRINTF for
%   details).
%
%   If the input array is integer-valued, num2str returns the exact string
%   representation of that integer. The term integer-valued includes large

    
function s = num2str(x, f)
%NUM2STR Convert numbers to a string.
%   T = NUM2STR(X) converts the matrix X into a string representation T
%   with about 4 digits and an exponent if required.  This is useful for
%   labeling plots with the TITLE, XLABEL, YLABEL, and TEXT commands.
%
%   T = NUM2STR(X,N) converts the matrix X into a string representation
%   with a maximum N digits of precision.  The default number of digits is
%   based on the magnitude of the elements of X.
%
%   T = NUM2STR(X,FORMAT) uses the format string FORMAT (see SPRINTF for
%   details).
%
%   If the input array is integer-valued, num2str returns the exact string
%   representation of that integer. The term integer-valued includes large
%   floating-point numbers that lose precision due to limitations of the 
%   hardware.
%
%   Example:
%       num2str(randn(2,2),3) produces the string matrix
%
%       '-0.433    0.125'
%       ' -1.67    0.288'
%
%   See also INT2STR, SPRINTF, FPRINTF, MAT2STR.

%   Copyright 1984-2005 The MathWorks, Inc.
%   $Revision: 299 $  $Date: 2006/11/11 22:45:08 $
%------------------------------------------------------------------------------
% if input does not exist or is empty, throw an exception
if nargin<1
    cfg_message('MATLAB:num2str:NumericArrayUnspecified',...
        'Numeric array is unspecified')
end