feval_w_path

feval_w_path(fpath, fname, varargin)

feval_w_path() - Calls a function located by the specified path.

FEVAL_W_PATH(FPATH, F, x1, ..., xn)
[y1, ..., yn] = FEVAL_W_PATH(FPATH, F, x1, ..., xn)

Identical to the built-in FEVAL, except that the function F need not be
in the MATLAB/Octave path if it is defined in a file in the path specified
by FPATH. Assumes that the current working directory is always first in
the MATLAB/Octave path.

Inputs:
    FPATH - string containing the path to the function to be called,
            can be absolute or relative to current working directory
    F - string containing the name of the function to be called
    x1, ..., xn - variable number of input arguments to be passed to F

Output:
    y1, ..., yn - variable number arguments returned by F (depending on
                  the caller)

Note that any sub-functions located in the directory specified by FPATH
will also be available to be called by the F function.

Examples:
    % Assume '/opt/testfunctions' is NOT in the MATLAB/Octave path, but
    % /opt/testfunctions/mytestfcn.m defines the function mytestfcn()
    % which takes 2 input arguments and outputs 1 return argument.
    y = feval_w_path('/opt/testfunctions', 'mytestfcn', x1, x2);