Beginner here with coding problem

Paul's right...you don't know what you're doing. The code you posted doesn't even compile.

Study this until you completely understand what every statement does:

void setup()
{
  Serial.begin(115200);
  output_array();
}

void loop()
{
}

void output_array() // generates a matrix of temperature data
{
  int i, j, index;
  float tempArray[4][4];
  
  index = 0;
  for (i = 0; i < 4; i++) {
    for (j = 0;j < 4; j++) {
      tempArray[i][j] = (float) index++;  // Fill the array
    }
  }
  for (i = 0; i < 4; i++) {
    for (j = 0;j < 4; j++) {
      Serial.print(tempArray[i][j]);      // Now show it
      Serial.print(" ");
    }
    Serial.print("\n"); 
  }
}