When you have not passed enough input arguments to a function, the error does not get complained about until you try to access an argument that was not passed in. If it so happened that signal was the missing argument that was accessed first then it would be the one complained about first.
How are you starting the routine? When a function takes parameters you pretty much must start it from the command line (or from a line of code); in particular if you try to start it from the menu or from pressing F5 then the routine will be executed without any arguments being passed in.
You say that you read in an image file but you do not say that you passed the image file in to the routine.
To check: are you aware that when you call a routine, that MATLAB does not look at the dummy parameter names of the routine (e.g, signal or beta) and look in the calling routine (or the base workspace) to try to find variables with the same name and use those values. Whatever value you want the routine to receive must be passed in specifically. The called routine does not have access to variables in the calling routine, not unless the called routine uses evalin() or the variable is a shared variable (and is not a parameter name.)