ERROR: Not enough input arguments.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Mary Evans
le 25 Sep 2020
Réponse apportée : Star Strider
le 25 Sep 2020
When I call my function, I get this error:
% Not enough input arguments.
% Error in CalcMKJointProb (line 26)
% for row = 1:obsData %loop through rows
However, if I copy & paste everything in my function (besides the function statement, of course) into the command window, it executes correctly and gets the result I want. I am not sure why this is or how to fix it.
0 commentaires
Réponse acceptée
Star Strider
le 25 Sep 2020
That error could be thrown if ‘obsData’ is a variable that should be passed to your ‘CalcMKJointProb’ function as an argument, and is not. This could be the case if you attempt to run your function by clicking on the green Run triangle in the MATLAB Editor, rather than calling it from a script with the appropriate inputs.
The only other explanation for that error that occurs to me is that ‘obsData’ is a function that requires inputs and then returns something that your for loop uses to determine the number of iterations for ‘row’. If so, you need to call it with the appropriate arguments.
0 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!