MATLAB: Inputname statement – useful example

Hi everyone,
could you help me to understand what is the useful of the inputname statement? I run the following example:
function c = somma(a, b)
disp(inputname(1))
c = a + b;
in workspace:
x = 1;
y = 2;
somma(x, y) %x is the result
From my example is not clear the useful of inputname. If you have a best example, let me know please.
Thank you.

Best Answer

inputname() is useful for giving error messages that reference variable names in the form the user knowns them.
Related Question