I have been trying to add and 128 ArrayList of double[][] to another array list. This is how the code looks like:
double[] localData = new double[nSamplesTaken.getValue()];
double[][] data = new double[200][200];
int d = 0;
for (int sampleIdx = 0; sampleIdx < nSamplesTaken.getValue(); ++sampleIdx) {
ArrayList arr2 = new ArrayList();
for (int i = 3; i < 17; i++) {
Edk.INSTANCE.EE_DataGet(hData, i, localData, nSamplesTaken.getValue());
data[d][i] = localData[sampleIdx];
arr2.add(data[d][i]);
}
System.out.println(arr2);
}
here, nSamplesTaken.getValue()
is always 4
,
Edk.INSTANCE.EE_DataGet(hData, i, localData, nSamplesTaken.getValue());
data[d][i] = localData[sampleIdx];
gives an array of number (different all the time) from an EEG device some thing like this
3999.48717948718
4388.205128205129
4441.025641025642
3659.48717948718
5070.769230769231
3971.2820512820517
4548.717948717949
4032.307692307693
4684.102564102564
4250.256410256411
4643.589743589744
4168.205128205129
4512.307692307693
4025.6410256410263
so I tried using the ArrayList arr2 = new ArrayList();
and added this data to this arr2
by doing arr2.add(data[d][i]);
which gave me
[3998.9743589743593, 4388.717948717949, 4440.512820512821, 3658.461538461539, 5072.307692307693, 3970.7692307692314, 4546.153846153847, 4032.307692307693, 4685.128205128206, 4250.256410256411, 4644.615384615385, 4168.205128205129, 4511.282051282052, 4026.1538461538466]
Now what I wanted in the end was to add 128 of these this list in another array list, but the catch is each array would be of different number which is generated by the Emotiv device. something like this
[[3998.9743589743593, 4388.717948717949, 4440.512820512821, 3658.461538461539, 5072.307692307693, 3970.7692307692314, 4546.153846153847, 4032.307692307693, 4685.128205128206, 4250.256410256411, 4644.615384615385, 4168.205128205129, 4511.282051282052, 4026.1538461538466],
[3999.48717948718, 4388.205128205129, 4441.025641025642, 3659.48717948718, 5070.769230769231, 3971.2820512820517, 4548.717948717949, 4032.307692307693, 4684.102564102564, 4250.256410256411, 4643.589743589744, 4168.205128205129, 4512.307692307693, 4025.6410256410263],
...]
can anyone tell me how to do it?
update:
How is my question related to Double precision?