Matlab/Simulink: How to enable external mode interface programmatically
In Matlab/Simulink, you can enable the external mode interface programmatically by using the following sequence of commands after the Simulink model is loaded:
% Enable interface -> External mode
set_param(getActiveConfigSet(gcs), 'ExtMode', 'on')
% Set external mode transport to TCP/IP
set_param(getActiveConfigSet(gcs), 'ExtModeTransport', Simulink.ExtMode.Transports.getExtModeTransportIndex(getActiveConfigSet(gcs), 'tcpip'))
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow