Rank: 87344 based on 0 downloads (last 30 days) and 0 file submitted
photo

Derek Eggiman

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by Derek
Updated File Comments Rating
23 Sep 2009 TCP/IP Communications in Matlab Sends/receives TCP packets using Matlab's Java interface. Now handles matrices and cell arrays, etc. Author: Kevin Bartlett

Very nice example. However I've noticed your read function could be improved or perhaps cleaned up a little. Instead of the while loop for timeout you could do the following.

import java.net.Socket
import java.net.InetSocketAddress

%Set SocketAddress
sAddress = InetSocketAddress(Host,Port);

%Establish unconnected socket.
socket = Socket();

%connect
try
socket.connect(sAddress,timeout);
end

Contact us