i have two machines running MATLAB and i need to exchange information(numbers,images) between them,is there a way in MATLAB i can do it?
4 Answers
If you have Parallel Computing Toolbox and MATLAB Distributed Computing Server, you can use MPI-style programming to send data between the two MATLAB processes. You can use functions like labSend
and labReceive
to send and receive data.

- 23,676
- 2
- 38
- 40
There are several possibilities without any extra toolboxes, depending on your specific needs. Check the Matlab help about external interfaces for details. For high performance, mexing a custom C communication is probably your best option. Using shared files on a network storage would be an alternative that is easier to implement but less effective, especially if you need frequent communication.

- 1,986
- 14
- 16
Adding some specifics to other answers, here's an example of using Java for sockets. multicore and MatlabMPI use the filesystem, so I believe if you have a shared network filesystem you could use them across machines. And here is an old implementation in C++.
We have direct experience only with multicore
, which is the least like real socket communication out of the above, but it gets the job done for coarsely parallel jobs.

- 2,108
- 2
- 16
- 17