Rank: 352 based on 171 downloads (last 30 days) and 7 files submitted
Personal Profile:

http://iheartmatlab.blogspot.com

Professional Interests:

 

Watch this Author's files

 

Files Posted by Rodney 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 4 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 ip, tcp, socket 37 1
  • 5.0
5.0 | 3 ratings
19 Aug 2008 TCP/IP Socket Communications in MATLAB A simple example TCP/IP server and client Author: Rodney Thomson how does client send ..., application, tcpip, test, socket, measurement 101 17
  • 5.0
5.0 | 4 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 18 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 utilities, directories, files, recurse, function handle, recursion 0 1
Comments and Ratings by Rodney View all
Updated File Comments Rating
29 Apr 2013 TCP Output Socket MATLAB TCP Output Socket using a Java helper class for threaded client connection management Author: Rodney Thomson

Oh I see what you mean now.

In that part of the example we are directly constructing the JAVA OBJECT (OutputSocket) and using that. The strange text (OutputSocket@1c68b29) is likely to be how Java objects are represented in MATLAB.

Likely it is saying <class/type>@<memory location>

29 Apr 2013 TCP Output Socket MATLAB TCP Output Socket using a Java helper class for threaded client connection management Author: Rodney Thomson

Thuong, that is entirely to be expected. You did not place a semi-colon (;) at the end of your statement so MATLAB plotted the result of the assignment to output_socket.

That is, it created a MatlabOutputSocket with no properties. You can click on 'Methods' in the command window to show the list of methods you can use (for this example it is just close() and write()!)

16 Jan 2013 TCP/IP Socket Communications in MATLAB A simple example TCP/IP server and client Author: Rodney Thomson

The next entry on the blog:
http://iheartmatlab.blogspot.com.au/2009/09/tcpip-socket-communications-in-matlab.html

Details using compiled Java class for pulling larger chunks of data from the socket at a time, returning them as MATLAB compatible arrays. It effectively wrappers the DataInputStream::read() method but returns an array, instead of taking an array by reference (which MATLAB cannot do)

15 Jan 2013 TCP/IP Socket Communications in MATLAB A simple example TCP/IP server and client Author: Rodney Thomson

Kinor:
With your specific example, I'd expect latency on average of between 1 and 2 seconds.

That is because the server is setup and a client polls to connect for each 'ping' and 'pong'. That takes time.

What you should do is use the code inside client.m and server.m AS AN EXAMPLE and tailor it to suit your application.

IE it looks like you have bi-directional comms. You could setup one machine as server and another as client, then use the Java DataOutputStream/DataInputStream objects on both the client and server to both read and write data without re-establishing a connection each time.

Also the client.m code reads bytes 1 at a time which is very slow. See some of my other code examples on how to do this differently.

04 Jan 2013 TCP/IP Socket Communications in MATLAB A simple example TCP/IP server and client Author: Rodney Thomson

jawad - Yes you can. Simply run 2 instances of MATLAB and run 'client' in one, and 'server' in the other.

Comments and Ratings on Rodney's Files View all
Updated File Comment by Comments Rating
31 Jul 2013 Display Cursor Location Display cursor coordinates within a plot axes window Author: Rodney Thomson Leslie

works fine
Thanks

29 Apr 2013 TCP Output Socket MATLAB TCP Output Socket using a Java helper class for threaded client connection management Author: Rodney Thomson Thomson, Rodney

Oh I see what you mean now.

In that part of the example we are directly constructing the JAVA OBJECT (OutputSocket) and using that. The strange text (OutputSocket@1c68b29) is likely to be how Java objects are represented in MATLAB.

Likely it is saying <class/type>@<memory location>

29 Apr 2013 TCP Output Socket MATLAB TCP Output Socket using a Java helper class for threaded client connection management Author: Rodney Thomson Thuong

Thank you, Rodney!
It works well now.

But what i meant is in your example, it shows that output_socket is:
>> output_socket = OutputSocket(1234)
output_socket =
OutputSocket@1c68b20
So, I dont understand what "OutputSocket@1c68b20" really means? Could you happen to explain about this.

29 Apr 2013 TCP Output Socket MATLAB TCP Output Socket using a Java helper class for threaded client connection management Author: Rodney Thomson Thomson, Rodney

Thuong, that is entirely to be expected. You did not place a semi-colon (;) at the end of your statement so MATLAB plotted the result of the assignment to output_socket.

That is, it created a MatlabOutputSocket with no properties. You can click on 'Methods' in the command window to show the list of methods you can use (for this example it is just close() and write()!)

28 Apr 2013 TCP Output Socket MATLAB TCP Output Socket using a Java helper class for threaded client connection management Author: Rodney Thomson Thuong

Hi Rodney,
Thank you for your helpful codes
I put all files in current working folder, and run two commands
>> javaaddpath(pwd)
>> output_socket=MatlabOutputSocket(1234)
But the result is
output_socket =

MatlabOutputSocket handle with no properties.
Methods, Events, Superclasses

I dont know why, would you help me with that
Thank you!

Top Tags Applied by Rodney
application, example, socket, utilities, development environment
Files Tagged by Rodney View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
27 Jun 2013 Screenshot Multi progress bar A new "shiny" progress-bar with multiple bars in a single window, time-estimates and more. Author: Ben Tordoff gui, progress bar, waitbar 96 35
  • 4.91667
4.9 | 25 ratings
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 4 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 ip, tcp, socket 37 1
  • 5.0
5.0 | 3 ratings
19 Aug 2008 TCP/IP Socket Communications in MATLAB A simple example TCP/IP server and client Author: Rodney Thomson how does client send ..., application, tcpip, test, socket, measurement 101 17
  • 5.0
5.0 | 4 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 18 4
  • 5.0
5.0 | 3 ratings

Contact us