getting the PID from matlab

  • I need the pid to know if one of the many simulations I run are still running. There's no native solution in matlab to my knowledge.


This post is certainly obsolete...

  • using hint @

  • create getpid.c with

    1 #include "mex.h"
    2 #include <unistd.h>
    3 mexFunction(int nlhs, mxArray *plhs[ ], int nrhs, const mxArray *prhs[ ])
    4 {
    5   plhs[0] = mxCreateDoubleScalar((double) getpid());
    6 }
  • compile with ``mex getpid.c ``

    System Message: WARNING/2 (<string>, line 22); backlink

    Inline literal start-string without end-string.

  • use in matlab as pid=getpid()

  • this is part of the package in SparseHebbianLearning


Comments powered by Disqus