MATLAB, or any standalone applications generated with MATLAB, must be allowed to communicate on all types of networks through Windows Defender Firewall.
This answer presents 3 possible solutions to allow MATLAB through Windows Defender Firewall:
- Solution 1: Use Windows Defender Firewall Prompt on First Connection
- Solution 2: Manually allow MATLAB through Windows Defender Firewall
- Solution 3: Create inbound and outbound rules for MATLAB in Windows Defender Firewall
- We recommend going through the steps below with your IT team and/or a system administrator.
- When allowing access for a standalone application, use Solution 2 or 3. Make sure that the application (e.g. "slrt_app.exe") is added to your firewall exception list rather than "matlab.exe".
- You must repeat the procedure below for every installed version of MATLAB and every standalone application that you intend to use with external hardware. The same applies if you upgrade MATLAB to a newer version at any point in the future.
- The steps below may also have to be repeated after any company-wide IT rollouts or Windows Updates, as firewall settings may be reset as part of this.
SOLUTION 1: Use Windows Defender Firewall Prompt on First Connection
When you first try to connect to a target computer from a certain MATLAB release, Windows Defender Firewall prompts you to allow MATLAB to communicate on Private and Public networks:1) Make sure that all options, including Private and Public options, are selected.
2) Click Allow access.
SOLUTION 2: Manually allow MATLAB through Windows Defender Firewall
In case you missed the above prompt, or did not check all options when prompted, you can configure the firewall manually:
1) Find Allow an app through Windows Firewall by using the Windows search.2) Click the Change settings button if necessary to unlock the panel. 3) Click Allow another app.
4) Click Browse to browse for <matlabroot>\bin\win64\matlab.exe. Or, if configuring a standalone application, include the file path for your standalone executable.
5) Click Network Types.
6) As the Network Type for MATLAB, select all options, including Private and Public.
SOLUTION 3: Create inbound and outbound rules for MATLAB in Windows Defender Firewall
If the above solutions don't help, try to configure additional Inbound and Outbound Rules in the Advanced Windows Defender Firewall settings:
1) Find Windows Defender Firewall with Advanced Security by using the Windows search.
2) Select Inbound Rules and New Rule.
3) For the Rule Type, select Program, and click Next.4) Select This program path and browse for <matlabroot>\bin\matlab.exe. 5) For the Action, select Allow the connection, and click Next.
6) For the Profile, select the Domain, Private, and Public checkboxes, and click Next.
7) For Name, provide a Name for this inbound rule (for example, Simulink Real-Time inbound), and click Finish.
8) Select Outbound Rules and click New Rule.
9) Repeat steps 3 through 7 for the custom outbound rule.
If any of the above options are not available due to IT policy, or the communication still fails, please contact your IT helpdesk to verify your firewall rules.
If the above instructions don't help resolve the communication issues with your Speedgoat hardware, refer to the following MATLAB Answers post for further troubleshooting steps: