Subtract Three dimention array from 2D : 
I have two data set,the first one is 3D and the second is 2D.

how can we implement the subtract of the two array.

the code bellow generate error :

        double[][] diff = new double[1][a.length];

        for (int i = 0; i < a.length - 1; i++) {
            for ( int j=0; j<a[0].length; j++){
               for ( int k=0; k<a[0][0].length; k++) {
                 
                  diff[0][i] = a[i][j][k]- b[i][j];
            }
        }
 }


