How do I use a value from the previous iteration in my current loop? I am generating a double [] v
and want to do v - w
where w is the value of v in the previous iteration. Obviously I need to implement subtraction for 2 arrays.
if (!e.getValueIsAdjusting())
{
double[] v = new double[uaCount.get(table.getValueAt(table.getSelectedRow(),0)).singleValues.size()];
int i = 0;
for(Long j : uaCount.get(table.getValueAt(table.getSelectedRow(),0)).singleValues)
{
v[i++] = j.doubleValue();
}
double [] w, r;
//implement r = v-w
System.out.println(String.valueOf(uaCount.get(table.getValueAt(table.getSelectedRow(),0)).singleValues));
dataset.addSeries("Histogram",r, 1000, 0, 120000);
}
the purpose of this is to add a new dataset to my histogram while getting rid of the previous one. Now that I think about this more though, subtracting the values will give me different answers right?