Too many input arguments error in executable.
Afficher commentaires plus anciens
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.
Réponses (1)
Walter Roberson
le 25 Juin 2018
0 votes
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.
Catégories
En savoir plus sur MATLAB Compiler dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!