The m-distance matrix D m of a simple connected undirected graph has an important role in computing the distance matrix D of the graph from the powers of the adjacency matrix using Hadamard product. This paper shows that for an undirected tree T with diameter d, {D 0 .D 1 ,. .. , D d } is an orthogonal basis for the space spanned by the binary equivalent matrices of the first d + 1 powers of the adjacency matrix of T and it gives an invertible conversion matrix for finding the m-distance matrix of T using Frobenius inner product on matrices.