Merging Arrays of Different Lengths

wueso19

New Member
I have several float arrays of different lengths. For example:\[code\]float[] array1 = new float{0, 2};float[] array2 = new float{2, 3, 0, 1, 1, 2, 0, 2};\[/code\]Each value is randomly generated (in this case between 0 and 4).I need to merge them so that they form an array the length of the longest array (in this case 8 values).The arrays need to "map" the values so that when "merged" the first value in my new array would be 2 (0 + 2, all the first values),the final value would be 4 (2 + 2, all the last values) and each value between would be calculated so for example...The fourth value would be 1.75; 1 (the fourth value of array2) + 0.75 (the value calculated between 0 and 2 of array1).Eventually I will be working with around 8 arrays, all different lengths, each with thousands of values so I really need an easy way to automate this process.
 
Back
Top