I have a Java program that makes some changes to a matlab file that reads and executes a function. Is there a way to invoke and run this read.m file through the Java program without having to open Matlab? I tried searching matlabcontrol documentation but I didnt find anything relevant. I would appreciate it if anyone could guide me through.
Thank you in advance.
public static void tomatlab() throws MatlabConnectionException, MatlabInvocationException {
        MatlabProxyFactoryOptions options =
            new MatlabProxyFactoryOptions.Builder()
                .setUsePreviouslyControlledSession(true)
                .build();
        MatlabProxyFactory factory = new MatlabProxyFactory(options);
        MatlabProxy proxy = factory.getProxy();
        proxy.eval("addpath('C:\\path_to_m_file)");
        proxy.feval("read");
        proxy.eval("rmpath('C:\\path_to_m_file')");
        // close connection
        proxy.disconnect();
    }