2

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.

Szabolcs
  • 24,728
  • 9
  • 85
  • 174

1 Answers1

6

Evaluate the following in MATLAB to get the PID:

feature('GetPid')

I found this here.

Szabolcs
  • 24,728
  • 9
  • 85
  • 174