I'm trying to write a general function in MATLAB that takes a function handle as one argument and a path as a second, with optional filters defining which files in the specified folder should be used. The idea is that the inputted function is then applied to all the matching files. However, I want to make sure that there's no uncontrolled crashing of this function, so I'd like to be able to check if the inputted function even takes files as input arguments.
So to sum up, I'd like to know if there's a way to find out if certain input is compatible with a certain function, with only the function handle to go on. I know MATLAB is very loose in these things but if there is a way, please do share it with me.
EDIT: I'm aware that there might be similar functions already built-in to MATLAB, I'm just looking to increase my knowledge and skill in MATLAB-coding.