I've installed R2017a and try to use Matlab Engine API for Java to run a user-defined script/function from Java.
The examples provided here(https://uk.mathworks.com/help/matlab/matlab_external/java-example-source-code.html) work perfectly fine. These examples, however, make use of Matlab package functions such as gcd, max etc.
I can't find any examples that enable to import and execute Matlab scripts (functions) defined by a user. Some examples for Python are provided here(https://uk.mathworks.com/matlabcentral/answers/322114-calling-script-from-python) but unfortunately, do not work in Java.
Any ideas how to achieve this functionality?