Easy way. Type in
raspi.internal.firmware.setupMATLABServer('<IP address>','<User name>','<Password>')
This should setup everything if it succeeds to execute the script. The user need root privileges and sudo without asking for the password.
If all fails.
in MATLAB and configure the settings.
MATLAB will download a file called raspberrypi_firmware_16_2_0.zip.
Unzip it and open the image file.
Copy the entire /opt to your existing installation.
The location /opt/MATLAB/server_v16.2.0/ is where the binaries live.
To start MATLAB run
sudo /opt/MATLAB/server_v16.2.0/matlabd <PORT NUMBER>
The port number is usually 18732 or the one you set.
To start the UDP daemon run
After this MATLAB/Simulink should work.