The "anonymous" in anonymous function doesn't refer to the contents being unknown. It refers to the fact that this function does not have a static name like a function within an m-file.
For example, if you create the following function, it can only be used by it's name, myfunction.
function out = myfunction(a,b)
With a function handle, however, it is assigned to a variable and that variable's name is used to call the function.
myfunc = @(a,b)disp('I am a walrus'); myfunc2 = myfunc;
Now the same function can be called using either myfunc() or myfunc2().
Now that we've gotten the nomenclature out of the way, if you are given a function handle, you can actually just display the function handle (using disp) and see the function definition (complete with input arguments).
f = @(a,b)disp('I am a sneaky function'); disp(f) f = @(a,b)disp('I am a sneaky function');
From this it's easy to infer that f takes two input arguments (a and b).
As far as what these input arguments should be and what that function does with those arguments, you'd have to look at the function component of the function handle or ask whoever created it. If you can't tell, this doesn't make it "anonymous", it just makes it poorly documented.
Most function introspection functions that would work on a regular function will also work on an anonymous function if you want to get information about the input arguments programmatically.
%// Get the number of input arguments nargin(f)
Update
If you used matlabFunction to generate an anonymous function from a symbolic expression, you can specify the input arguments in the call to matlabFunction using the Vars input.
As an example from the documentation.
syms x y z t r = (x + y/2 + z/3)*exp(-t); %// The first input argument will be t and the second will be an array of [x,y,z] matlabFunction(r, 'Vars', {t,[x y z]}); %// @(t,in2)exp(-t).*(in2(1)+in2(2).*(1.0./2.0)+in2(3).*(1.0./3.0));
Or as another example where I use an array rather than a cell array containing the values. They will then all appear as separate inputs to the anonymous function by name.
syms x y z r = x + y/2 + z/3; matlabFunction(r, 'Vars', [x,y,z]); %// @(x,y,z)x+y.*(1.0./2.0)+z.*(1.0./3.0);
If you do not specify them, MATLAB automatically chooses the order as specified in the documentation:
By default, when you convert symbolic expressions, the order is alphabetical. When you convert symbolic functions, their input arguments appear in front of other variables, and all other variables are sorted alphabetically.
Update 2
If you really want some way to inspect the input variables of an anonymous function, here is a little anonymous function to do that for you.
anoninputs = @(f)strsplit(regexp(func2str(f), '(?<=^@\()[^\)]*', 'match', 'once'), ',');
Now we can test it like:
f = @(a,b)disp('Just another function. Do not mind me'); anoninputs(f) 'a' 'b'
coeffnames(f)fromcfitobjects....