Rank: 454 based on 309 downloads (last 30 days) and 7 files submitted
photo

Rodney Thomson

E-mail
Lat/Long
-32.0660667419434, 115.748168945313

Personal Profile:

http://iheartmatlab.blogspot.com


 

Watch this Author's files

 

Files Posted by Rodney Thomson View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
21 Jun 2010 Screenshot TCP Output Socket MATLAB TCP Output Socket using a Java helper class for threaded client connection management Author: Rodney Thomson tcp, socket, java 26 4
  • 4.0
4.0 | 2 ratings
07 Sep 2009 TCP/IP Socket Communications in MATLAB using Java Classes A simple example TCP/IP server and client using a helper Java class Author: Rodney Thomson tcp, ip, socket 54 6
  • 5.0
5.0 | 5 ratings
19 Aug 2008 TCP/IP Socket Communications in MATLAB A simple example TCP/IP server and client Author: Rodney Thomson example, application, socket, tcpip, test, measurement 156 26
  • 5.0
5.0 | 5 ratings
30 Jul 2008 Screenshot Display Cursor Location Display cursor coordinates within a plot axes window Author: Rodney Thomson annotation, customization, windowbuttonmotionfcn, plot, display, cursor 26 4
  • 5.0
5.0 | 3 ratings
22 Jul 2008 Recursive Directory Function Execution Recurse through all directories executing the supplied function Author: Rodney Thomson path, directories, files, recursion, function handle, recurse 14 1
Comments and Ratings by Rodney Thomson View all
Updated File Comments Rating
08 May 2014 TCP/IP Socket Communications in MATLAB A simple example TCP/IP server and client Author: Rodney Thomson

@nothing: It is probably best if you email me. Address in on my profile page

01 May 2014 TCP/IP Socket Communications in MATLAB A simple example TCP/IP server and client Author: Rodney Thomson

@nothing: You can either:
- Call readbyte enough times to get the data you want in a byte array, and then use the MATLAB command 'typecast' tonconvert values in the array to the desired type
- Call the DataInputStream methods: readDouble, readFloat, readShort, readInt etc, see http://docs.oracle.com/javase/6/docs/api/java/io/DataInputStream.html for more details

29 Apr 2014 TCP/IP Socket Communications in MATLAB A simple example TCP/IP server and client Author: Rodney Thomson

@nothing: To do that, you need to do something like the following:

server.m:
% once you have the Socket (after a successful call to server_socket.accept) you would get a input stream and read as in client.m

output_socket = server_socket.accept;
input_stream = output_socket.getInputStream;
d_input_stream = DataInputStream(input_stream);

bytes_available = input_stream.available;
message = zeros(1, bytes_available, 'uint8');
for i = 1:bytes_available
message(i) = d_input_stream.readByte;
end

client.m:
% again, like above but in reverse. Once a connection is established you get an output stream and write
output_stream = input_socket.getOutputStream;
d_output_stream = DataOutputStream(output_stream);
d_output_stream.writeBytes(char(message));
d_output_stream.flush;

25 Apr 2014 TCP/IP Socket Communications in MATLAB A simple example TCP/IP server and client Author: Rodney Thomson

@nothing : Of course, so long as TCP/IP is used over the interface!

Should be no different to localhost / ethernet / wifi. Just point it at the host and port.

02 Oct 2013 TCP/IP Socket Communications in MATLAB using Java Classes A simple example TCP/IP server and client using a helper Java class Author: Rodney Thomson

Bi-directional coms can be done by a single socket, although you still need a 'server' and a 'client'. Someone needs to wait for a connection, and the other needs to initiate the connection.

When you get the Java Socket() object, you can get both an InputDataStream and an OutputDataStream (or even a DataStream) and then read/write with the relevant stream.

Comments and Ratings on Rodney Thomson's Files View all
Updated File Comment by Comments Rating
07 Nov 2014 TCP/IP Socket Communications in MATLAB using Java Classes A simple example TCP/IP server and client using a helper Java class Author: Rodney Thomson Sergio

02 Aug 2014 TCP/IP Socket Communications in MATLAB A simple example TCP/IP server and client Author: Rodney Thomson Narayani

Hi, I have a python script reading data from a USB device. I want to make this data continuously available to the model in Simulink. I tried TCP/IP but doesn't seem to work. How can I set them both up? Appreciate your suggestions.

08 May 2014 TCP/IP Socket Communications in MATLAB A simple example TCP/IP server and client Author: Rodney Thomson Rodney Thomson

@nothing: It is probably best if you email me. Address in on my profile page

08 May 2014 TCP/IP Socket Communications in MATLAB A simple example TCP/IP server and client Author: Rodney Thomson nothing

Thanks for reply!But I have got a problem that I can not receive data correctly by using the code you show me. The datas I received are always same.

01 May 2014 TCP/IP Socket Communications in MATLAB A simple example TCP/IP server and client Author: Rodney Thomson Rodney Thomson

@nothing: You can either:
- Call readbyte enough times to get the data you want in a byte array, and then use the MATLAB command 'typecast' tonconvert values in the array to the desired type
- Call the DataInputStream methods: readDouble, readFloat, readShort, readInt etc, see http://docs.oracle.com/javase/6/docs/api/java/io/DataInputStream.html for more details

Contact us