I have to use MATLINK to connect to MATLAB to run some programs. Variables can be get using MGet and assigned to a variable using MSet. However, I want to use ParallelMap (and other parallel functions) to set and get the variables from MATLINK. One way suggested here installs the mathlink into all parallel kernels. I tried to do the same with MATLINK and installed mengine into all parallel kernels using ParallelEvaluate[Install["mengine"]]. It created link objects. Now when I try to run ParallelMap, it is not working. The output is Not connected to the MATLAB engine.
How can I use MATLINK in parallel kernels?
Installdirectly. You simply need to load the package on all parallel kernels (ParallelNeeds) and start a MATLAB session from each (ParallelEvaluate[OpenMATLAB[]]). These will be distinct MATLAB sessions that do not share any variables. – Szabolcs May 05 '18 at 09:14MGet[]if I run in Parallel kernels, I can share the variables and compute it faster – no-one May 07 '18 at 21:17