"Not Enough Input Arguments" Error

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 30x2 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.

 Accepted 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.

2 Comments

D'oh! I was just running it from inside the Editor window. Thank you, I called the variables and it ran without error. Thank you for your help.
As always, my pleasure!
Rest assured that you are not the only person ever to do that.

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!