2d 3*3 LED matrix code error
Variable i &amp; j are not declared. They should be declared as 3. Try this:

const int x = 3;
const int y = 3;

int pinMatrix[x][y] = {{2, 3, 4}, {5, 6, 7}, {7, 8, 9}};

void setup() {
  for (int i = 0; i &lt; 3; i++) {
    for (int j = 0; j &lt; 3; j++) {
      pinMode(pinMatrix[i][j], OUTPUT);
    }
  }
}

void loop() {
  for (int i = 0; i &lt; 3; i++) {
    for (int j = 0; j &lt; 3; j++) {
      digitalWrite(pinMatrix[i][j], HIGH);
      delay(1000);
      digitalWrite(pinMatrix[i][j], LOW);
    }
  }
}