“Matlab Error: Too many input arguments “

Asked By 0 points N/A Posted on -
qa-featured

Hi everyone!

I'm a student using MatLab for research. Some of the formulas we work on are pretty complicated.

At times this error comes up. All the inputs were checked beforehand to be correct before they are entered.

Still, sometimes this error would not go away.

Does anyone with experience in MAtLAb have a solution to his?

Thanks a lot for any help!

Matlab: TooManyInputs

Matlab Error: Error using==> conversion_calc

Too many input arguments

SHARE
Best Answer by Dexter Alberto
Answered By 0 points N/A #95815

“Matlab Error: Too many input arguments “

qa-featured

Hello EliseE,

I'm so sorry to hear your problem about Matlab. 

I think that somewhere in your Path settings before the path of the file you have made you probably have another file with the same name and different arguments.

And because files are search top down the other file is found first which causes  that kind of error.

I suggest that you check your Path settings and check if you already have the same file name and different arguments.

I hope that this will help you solve your issue.

Nathan

Best Answer
Best Answer
Answered By 0 points N/A #95816

“Matlab Error: Too many input arguments “

qa-featured

Hi  EliseE,

The error occurs because the function you are trying to call expects fewer input arguments. This can be caused by:

  1. You have passed more arguments to a function than it expects to receive. This can be brought about by passing a list of inputs rather than a vector or obtaining multiple inputs from a function which provides only one output.
  2. You have multiple functions with the same name.

The solution can be to stop MATLAB execution when the error occurs and verify the correct number of input arguments have been provided and no function has duplicate name.

The other option is to use the NARGIN NARGOUT functions. When called inside a function, the function NARGIN returns the number of inputs specified in the call to the function executing.

Thank you.

Related Questions