How did you call the function? When you get an error, report the ENTIRE error message, everyting in red. This lets us know how you called the function.
Just because you have a variable named ScanRate in your workspace does not tell MATLAB to automatically pass it into your function.
If you want the function to see the variable, then you NEED to pass it in. Call it like this:
[frq, amp, phase] = simpleFFT( signal, ScanRate);
So you need ot pass in TWO arguments to your function. They can have any names as you pass them in, but inside the function, now ScanRate will be defined.
If you don't, well, then MATLAB will generate an error - the one you got.