I don't know quite how to describe what I want to do, but here it goes:
I want to have a function that takes every Nth value of a subarray and outputs it into a 1D array. The array that it is taking data from has two dimensions, one with between 1 and 8 thousand elements, each subarray containing 42 elements. I want to take every 3rd element (for example) of every element and output that into a single array. This is not the problem, though.
I want to have a function take, preferably as input, the multidimensional array to be broken up, and the type of the output array, as well as the integer which represents which of the 42 subarray elements to extract and pipe to the separate, secondary array. The second item is the one that is of interest to me. I want to know if it is possible for a function to take type (e.g. int, float, double, String[]) as an input so that the output type can vary depending on the input value. I may find a simpler way to do this after more thought, but in the meantime, is there a way for a function to take a type as input?
I can provide example code if necessary.
Thanks,
~JS
1