Rank: 422 based on 269 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 11 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 58 8
  • 4.83333
4.8 | 6 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 130 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 17 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 5 1
Comments and Ratings by Rodney Thomson View all
Updated File Comments Rating
11 Dec 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

Hi Jacobo, I have used these functions to read 16-channel 96kHz sampled 16-bit audio before without issue.

If you are attempting to read the data 1000 times per second then you may have a problem. Read more data less ofter to avoid function call overhead. For example, I read the acoustic data in 0.25 second chunks (24000 samples at a time).

Use the MATLAB profiler tool to see where your code is spending its time. Also, is it using high CPU load or high network load at this time? The issue could be in a number of places.

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.

Comments and Ratings on Rodney Thomson's Files View all
Updated File Comment by Comments Rating
11 Dec 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 Rodney Thomson

Hi Jacobo, I have used these functions to read 16-channel 96kHz sampled 16-bit audio before without issue.

If you are attempting to read the data 1000 times per second then you may have a problem. Read more data less ofter to avoid function call overhead. For example, I read the acoustic data in 0.25 second chunks (24000 samples at a time).

Use the MATLAB profiler tool to see where your code is spending its time. Also, is it using high CPU load or high network load at this time? The issue could be in a number of places.

10 Dec 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 Jacobo

I used these functions and work well. They are very easy to adapt. But I'm having a problem receiving data fast enough (~100 Double @ 1000Hz) ther is anyway to solve this?

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

Contact us