Subsystem Created
Compiled block added to the model.

(S-Function created)
Solved the problem. Now it should work properly
Bearing computation.

I added the computation of the bearing to the simulink model. Now I have a matrix (3*n_robots x n_robots) which contains the bearings between every robot in the simulation.