This MATLAB example shows how to use radarDataGenerator for a closed-loop simulation of a multifunction phased array radar (MPAR). The example starts by defining MPAR system parameters and parameters of three radar tasks: volume search, cued search, and tracking. The example then sets up a scenario with multiple maneuvering targets. At each update interval the tasks request resources from the MPAR to search for targets and revisit existing tracks. The example shows how different radar tasks that share the radar bandwidth and aperture can be executed in parallel. The simulation loop is closed by passing target detections back to the radar tasks to update their internal state and generate new look requests.