Skip to content

Instantly share code, notes, and snippets.

@markuman
Created June 10, 2015 19:29
Show Gist options
  • Save markuman/7198f58bb9ad491d02ae to your computer and use it in GitHub Desktop.
Save markuman/7198f58bb9ad491d02ae to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 10 20:42:05 2015
@author: markus
"""
import matlab.engine
DEFAULT_WORKER = 1
## MATLAB PYTHON ENGINE IS NOT THREAD SAFE!!
def workerSetup(num=DEFAULT_WORKER):
worker = []
for n in range(0, num):
worker.append(matlab.engine.start_matlab())
return worker
m = workerSetup()
test = m[0].ver()
print(test)
m[0].quit()
print(m)
print(m[0])
## MAIN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment