How does a misplaced comma lead to the 'too many input arguments' error?

Responsive Ad Header

Question

Grade: Education Subject: Support
How does a misplaced comma lead to the 'too many input arguments' error?
Asked by:
72 Viewed 72 Answers

Answer (72)

Best Answer
(318)
A misplaced comma can cause MATLAB to interpret subsequent data as separate input arguments that the function doesn't expect. For instance, `func(a,b,c)` is different from `func(a, b c)` where the space might not be enough to separate inputs, or `func(a, b, c)` where an extra comma might be seen as a fourth argument.