开发者

socket programming in MATLAB?

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?


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.


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.


for an example of socket programming in MATLAB using Java, see this related post


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜