Following this answer : https://stackoverflow.com/a/8988568/1357553 , regarding how to pass command line arguments to an EXE generated by Matlab Compiler, I would like to know how to receive the results returned by the function after all calculations
Asked
Active
Viewed 476 times
1 Answers
1
I can see 3 methods:
Save the results to a file.
Print the results to the terminal, either to stdout or to stderr, using
fprintf(1, ...)
orfprintf(2, ...)
.Return an exit code with
exit(code)
. This might work if you just want to return an integer.
Solution 2 and 3 might only work on linux. This website has some more info about passing data into and out of the command line. I am not sure if this also works for compiled code, I do not have the Matlab compiler. It depends a bit on the type of data that you want to return. For anything more complex than a simple number, solution 1 is probably the best way.

Bas Swinckels
- 18,095
- 3
- 45
- 62