Let T be a tree with vertex set [n]={1,2,…,n}. For each e3353a5bb505db2ff8a27c0ab94a734" title="Click to view the MathML source">i∈[n], let e3b2444e02aca7cbe" title="Click to view the MathML source">mi be a positive integer. An ordered pair of two adjacent vertices is called an arc. Each arc (i,j) of T has a weight Wi,j which is an mi×mj matrix. For two vertices e381260a5b2d004c76c0" title="Click to view the MathML source">i,j∈[n], let the unique directed path from i to j be Pi,j=x0,x1,…,xd where e348e4a1b1468b8e73d5a10c" title="Click to view the MathML source">d⩾1, x0=i and xd=j. Define the product distance from i to j to be the mi×mj matrix Mi,j=Wx0,x1Wx1,x2⋯Wxd−1,xd. Let . The N×N product distance matrix D of T is a partitioned matrix whose (i,j)-block is the matrix Mi,j. We give a formula for det(D). When det(D)≠0, the inverse of D is also obtained. These generalize known results for the product distance matrix when either the weights are real numbers, or m1=m2=⋯=mn=s and the weights Wi,j=Wj,i=We for each edge e={i,j}∈E(T).