ERROR: Not enough input arguments.
조회 수: 1 (최근 30일)
이전 댓글 표시
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
채택된 답변
Star Strider
2020년 9월 25일
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
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!