Not enough input arguments

2 views (last 30 days)
Priya Arasu
Priya Arasu on 6 Jan 2017
Edited: Stephen23 on 6 Jan 2017
I have started to use MATLAB, so I am not sure about the error. When I run the attached matlab script file, I get the following error.
>> predictClassRFWithScores
Error using predictClassRFWithScores (line 22)
Not enough input arguments.
Any insight about the error would of great help. Thank you

Answers (1)

Stephen23
Stephen23 on 6 Jan 2017
Edited: Stephen23 on 6 Jan 2017
predictClassRFWithScores is a function, not a script. It requires three inputs. However when you call it you are not providing it with any inputs. It is just like if you call this
sin()
and then complained that you are not getting any output from the sine function. What do you expect MATLAB to do, invent some values to use?
Possibly you are clicking the green button in the ribbon. Don't. Call the function from the command line, providing it with its required input arguments. Very basic things like calling functions and defining variables (that you can use as arguments) are explained in the introductory tutorials:

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!