Too many input arguments error in executable.
Show older comments
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.
Answers (1)
Walter Roberson
on 25 Jun 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.
Categories
Find more on MATLAB Compiler in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!