# 2d arrays not reconised by function

**URL:** <https://discourse.processing.org/t/2d-arrays-not-reconised-by-function/1006>\
**Category:** Processing\
**Created:** [June 16, 2018, 7:19am UTC](https://discourse.processing.org/t/2d-arrays-not-reconised-by-function/1006 "2018-06-16T07:19:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ElectroSquid](https://avatars.discourse-cdn.com/v4/letter/e/a88e57/32.png) [@ElectroSquid](https://discourse.processing.org/u/ElectroSquid)\
**Post date:** [June 16, 2018, 7:19am UTC](https://discourse.processing.org/t/2d-arrays-not-reconised-by-function/1006/1 "2018-06-16T07:19:47Z")

</div>

i have a function (not complete) thats supposed to asjust 2 variables based on 2 2darrays, in[][] and out[][], but i get the error msg: the function error() expects parameters like error(float[][],float[][])  
heres the faulty code: `void AdjustWeights(ArrayList<Float> w, float[][] in,float[][] out) { error(in[][],out[][]); }`

and heres the error() function:

```auto
float temp=0;
for(int k=0; k<=in.length-1; k++) {
    for(int i=0; i<=in[0].length-1; i++) {
         temp= sign(in[k][i], in.length)-sign(out[0][i],out.length);    
    }
}
return temp;
  }

```

---

<div class="post-metadata">

**Author:** ![ElectroSquid](https://avatars.discourse-cdn.com/v4/letter/e/a88e57/32.png) [@ElectroSquid](https://discourse.processing.org/u/ElectroSquid)\
**Post date:** [June 16, 2018, 7:22am UTC](https://discourse.processing.org/t/2d-arrays-not-reconised-by-function/1006/2 "2018-06-16T07:22:34Z")

</div>

whoops, sily me, the [][] are not supposed to be there, so the correct code is `error(in,out)` not `error(in[][],out[])`
