Adding output arrays dynamically is not possible [to my knowledge] - so either go for 2D array [ if uniform data size] or, 1D array of cluster where each cluster contains an array as the output data format. A simple logic can parse the data into any of these output format. Hope this helps!