MATLAB: Simultaneous/parallel tasks

simultaneous/parallel tasks

Hi, this is my first spread and hope some feedbacks. I need to do the following tasks simultaneously. How can I use Matlab to achieve it? (1) Download data every second from a remote terminal/server. (2) Process the data to judge if the secondly updated data satisfy certain conditions or not. (3) When certain conditions are met, send commands to the remote terminal/server to operate tasks.

Best Answer

You can use timer() objects to run a routine at periodic intervals.
You can download data in multiple ways, including ftp(); urlread(); the fairly new webread(); scp() from the File Exchange, or by using tcp() to request the data.
One difficulty you will need to deal with is that downloading the data may require more than one second. TCP connections retry when data packets are dropped, so TCP based requests can take an indefinite amount of time to return.
All of the ways I listed to download data can also be used to send commands to a server.