Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

inputname

Get variable name of function input.

Syntax

  • s = inputname(argNumber)

Input argument

  • argNumber - a scalar, real, positive integer value: Number of function input argument

Output argument

  • s - character vector: variable name

Description

inputname get variable name of function input.

inputname is only useable within a function

Example

function R = getinputname(varargin)
    R = string([]);
    for i = 1:nargin
        R = [R, string(inputname(i))];
    end
end

See also

nargin.

History

VersionDescription
1.0.0initial version

Author

Allan CORNET