	subroutine res_matrix(iObjects,iAttributes,rDataMatrix,
     +			      rResMatrix)

	real rDataMatrix(1:iObjects,1:iAttributes)
	real rResMatrix(1:iObjects,1:iObjects)
	real rObject1(1:10000)
	real rObject2(1:10000)

	do i=1,iObjects
	  do j=1,iObjects
	  iCount=0
	    do k=1,iAttributes
	      iCount=iCount+1
	      rObject1(iCount) = rDataMatrix(i,k)
	      rObject2(iCount) = rDataMatrix(j,k)
	    enddo
	    call eucl_dist(iAttributes,rObject1,rObject2,rEucDist)
	    rResMatrix(i,j) = rEucDist
	  enddo
	enddo

	return
	end
