The main motivation of this work is to propose a simulation approach for a specific task within the UAV (Unmanned Aerial Vehicle) field, i.e., the visual detection and tracking of arbitrary moving objects. In particular, it is described MAT-Fly, a numerical simulation platform for multi-rotors aircraft characterized by the ease of use and control development. The platform is based on Matlab R and the MathWorks TM Virtual Reality (VR) and Computer Vision System (CVS) toolboxes that work together to simulate the behavior of a drone in a 3D environment while tracking a car that moves along a non trivial path.The VR toolbox has been chosen due to the familiarity that students have with Matlab and because it allows to move the attention to the classifier, the tracker, the reference generator and the trajectory tracking control thanks to its simple structure. The overall architecture is quite modular so that each block can be easily replaced with others by simplifying the development phase and by allowing to add even more functionalities.The simulation platform makes easy and quick to insert and to remove flight control system components, testing and comparing different plans when computer vision algorithms are in the loop. In an automatic way, the proposed simulator is able to acquire frames from the virtual scenario, to search for one or more objects on which it has been trained during the learning phase, and to track the target position applying a trajectory control addressing what is well-known in the literature as an image-based visual servoing problem. Some simple testbeds have been presented in order to show the effectiveness and robustness of the proposed approach as well as the platform works. We released the software as open-source, making it available for educational purposes.Keywords image-based visual servoing · 3D simulation scenario · MATLAB/Simulink · multi-rotors · educational · vision detection and tracking · UAV · software-in-the-loop · computer vision · trajectory control