I think this might be more about the way evalin works and not specific to inputname. If you define the following functions in Matlab, what happens when you have some variables in the top-level workspace and you call f(), g(), and h()? Do you get the results you expect?
function f ()
evalin ('caller', 'who')
end
function g ()
gvar = 13;
f ()
end
function h ()
hvar = 42;
evalin ('caller', 'f')
end
>> topvar = 0;
>> f () %% Expect 'topvar' in list of vars from 'who'
>> g () %% Expect 'gvar' in list of vars from 'who'?
>> h () %% What happens here? Octave says 'hvar'.
If Matlab behaves differently, then report that as a bug. If they both behave the same, then I’ll have a look at precisely what is happening there and try to explain it.