Why do I get the error message "Too Many Input/Output Arguments" when I try to execute a function?
显示 更早的评论
Why do I get the following error messages:
Too many output arguments.
Too many input arguments.
Not enough input arguments.
采纳的回答
更多回答(1 个)
Limabean
2017-5-5
16 个投票
I found an additional way to get the the error "too many input arguments"
I had a class defined in an @folder, with functions in their own files. The primary class definition contains a signature for the function. I had declared 2 arguments in the function, but the signature for the function in the main file still had just one argument.
Solution: make sure the arguments listed in the function signature in your class file matches the arguments in the function you defined in the separate file.
This same thing holds true for "too many output arguments" as well; make sure the function signature matches.
类别
在 帮助中心 和 File Exchange 中查找有关 Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!