Too many input arguments error in executable.

I compiled an .exe based on a function that I set in matlab. The executable runs normally when I execute it myself, but it informs the error 'Too many input arguments' when an external program tries to call it.

Respuestas (1)

Walter Roberson
Walter Roberson el 25 de Jun. de 2018

0 votos

Remember that when a compiled MATLAB function is invoked, every space-delimited string is (typically) passed as a different argument. If the calling sequence is not careful, that can cause filenames that have spaces in them to be split into multiple arguments.
Remember too that what reaches your function arguments is character vectors, never actual numbers.
You should redefine your function to add varargin at the end of the argument list, and then if the number of arguments is not what you expect, produce an error message that helps debug the problem by displaying the argument list with boundaries between the pieces.

Categorías

Más información sobre MATLAB Compiler en Centro de ayuda y File Exchange.

Preguntada:

el 25 de Jun. de 2018

Respondida:

el 25 de Jun. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by