isfunction

isfunction checks if a function exists.

Syntax

  • check =isfunction(funstr)example
  • [check , location]=isfunction(___)example

Description

Returns 1 if the function 'funstr' exists, 0 otherwise. Also returns the location of the function, which is empty if funstr does not exist. Works for both MATLAB and third party functions, e.g. those in FSDA. REMARK:

does not work for built-in functions such as sin, cos, etc.

example

check =isfunction(funstr) check if a function of the statistical toolbox exists.

example

[check , location] =isfunction(___) check if a function of the FSDA toolbox exists.

Examples

expand all

  • check if a function of the statistical toolbox exists.
  • [check , location] = isfunction('regress');

  • check if a function of the FSDA toolbox exists.
  • [check , location] = isfunction('FSR');

    Input Arguments

    expand all

    funstr — Function name. String.

    The function to be checked.

    Data Types: String

    Output Arguments

    expand all

    check —Flag indicating the file existance. Boolean {1,0}

    1 if function 'funstr' exists, 0 otherwise.

    Data Types - Logical

    location —Function path. String

    The location of the function, which is empty if 'funstr' does not exist.

    Data Types - String

    References

    See Also

    |

    This page has been automatically generated by our routine publishFS