Question

When using the MATLAB Engine interface, how can I get the process ID of the matlab process that is started? Or how can I launch the matlab process in a way that would allow me to also get the PID?

The reason why I need this is to be able to interrupt calculations when they take too long. On *nix systems this seems to work by sending a SIGINT signal to MATLAB. This won't kill MATLAB, but it will interrupt the current calculation.

Was it helpful?

Solution

Evaluate the following in MATLAB to get the PID:

feature('GetPid')

I found this here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top