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

Why are you fixated on floating point numbers?
Integers are much easier to handle, and don't suffer the loss of precision multiple conversions will almost inevitably bring using floats.