How to create a distance matrix using the HC-SR04 sensor?

code from ino:

void setup() {
 
  
  Serial.begin(9600);
  
 float data = 1.23;
  for (int i =0; i<10;++i)
  {
    float fin = (float)i/data;
    Serial.println(String(fin));
  }
  
}

one thing i need to add, the data transfers successfully only when the red button is pressed and hold for 5-6 sec and releasing.