Matlab/Simulink: How to receive MATLAB commands via HTTP GET request

This example shows how to receive MATLAB commands via HTTP GET request.

In our previous example Matlab TCP/IP command server without any toolboxes we showed how to create a TCP/IP server in MATLAB without resorting to toolbox-only commands. However, even when being run using a Matlab Timer, it will block the GUI completely since Matlab inherently runs in a single-threaded way.

In this example, we’ll use a different strategy: Matlab itself is commanded via a Timer to periodically issue a HTTP request to an external Webserver. The webserver will then respond with a command to be executed in Matlab.

In this example, there is no feedback whatsoever on the output of the command!

Main MATLAB request function

MATLAB Timer

Python server

This simple example server will issue commands to alternatingly switch on and off a manual switch.


Check out similar posts by category: Matlab/Simulink, Python