function varargout = mainFuncForNumericStandaloneApplication( varargin )
%  main function entry point for numeric standalone application

%   Copyright 2017-2020 The MathWorks, Inc.

    if nargin == 0
       error(message('MCR:mainFuncForNumericStandaloneApplication:COM_ERROR_MISSING_FUNCTION_NAME'));
    end
    funcname = varargin{1};
    for i = 2:length(varargin)
        varargin{i} = findArgType(varargin{i});
    end
    [varargout{1:nargout}] = feval(funcname, varargin{2:length(varargin)}); 
end

function output_args  = findArgType( input_args )
    if (mclisnumerictype(input_args))
      input_args = eval(input_args);
      output_args = input_args;
    else
      error(message('MCR:mainFuncForNumericStandaloneApplication:COM_ERROR_INPUT_ARGUMENT_TYPE', ...
                             input_args));
    end
end
