First, all the input variables of function are in the workspace. Then, I enter the function in the command window like this and I can get the results:
However, directly running in the m file , that will cause a fault:
So, what's wrong and how can I run the m file correctly?