MATLAB: “Not Enough Input Arguments” Error

MATLABnot enough input arguments

Hello,
I am working with a code where I am stuck with a "Not Enough Input Arguments" error, even though it looks like the input arguments are listed. Specifically:
function [primeArray hR fA c] = proprioDPrimeAnalysis(oneCM, twoCM, threeCM, fourCM)
diffInd = find(oneCM(:,1) < -0.001);
the second line defining 'diffInd' causes the error. However, 'oneCM' is already defined as a 30×2 double array in the workspace:
0 0
0 0
0 0
0 0
-0.01 0
-0.01 0
0 1
0 1
0 0
-0.01 0
-0.01 1
0 0
0 1
0 1
-0.01 1
0 0
-0.01 0
-0.01 1
0 0
-0.01 0
-0.01 1
-0.01 1
-0.01 0
-0.01 1
0 0
-0.01 0
0 0
-0.01 1
-0.01 0
0 0
Please let me know if I am missing something, or if there is more I can provide.
Thank you.

Best Answer

How are you calling your ‘proprioDPrimeAnalysis’ function?
You must call it with all the input arguments as:
[primeArray hR fA c] = proprioDPrimeAnalysis(oneCM, twoCM, threeCM, fourCM);
It will not magically pick up any variables from your workspace, unlike anonymous functions.