0

I need to make a simple simulation in Matlab. It consists of me (the client) sending a binary vector b to a server. This server contains already a vector x. I want it to calculate the innerproduct between vectors b and x and send it back to me.

Is it possible to create different independent servers in matlab (in one computer) that can exchange information with each other? is Using TCP/IP Server Sockets a good idea?

Please help me

  • It's possible - but matlab is not really suited as server. If you really need to work with it I strongly suggest you use another language for that. – bdecaf Apr 23 '14 at 10:03

2 Answers2

0

Using TCP or UDP would make the simulation generalizable to servers on other computers. Interfaces for these protocols can be found in the Instrument Control Toolbox, but if you don't have that then several toolboxes on the File Exchange also provide interfaces. This one seems the most up to date.

An alternative is to communicate via a memory-mapped file, which MATLAB supports natively, but this would not work if the server were running on a different computer.

user664303
  • 2,053
  • 3
  • 13
  • 30
0

If you don't want to use any other Matlab toolboxes use could write a simple Java TCP sever and client and instantiate them from Matlab.

This previous question is on calling Java from Matlab.

There are many tutorials for setting up Java TCP servers and clients.

Community
  • 1
  • 1
MattyG
  • 81
  • 3