You want to generate a random matrix with a known determinant?
A = A*sign(DA)*nthroot(Dtarget/abs(DA),n)
A =
0.9922 0.4403 -0.2089 -0.2847 -1.4401 -0.8839 -0.3974
0.9601 -0.5051 -0.9957 -1.5741 -0.5598 0.1125 0.6553
-1.7138 -0.6681 -0.8090 -0.3641 0.9679 -0.7558 0.1677
-0.2605 0.3534 1.4410 -0.7409 -2.2699 0.1544 -0.9737
-0.1658 -0.3712 0.7740 -0.8034 -2.3909 -0.4586 0.3298
-1.6123 -0.7431 -0.8667 0.8437 0.6098 0.9010 0.1605
-0.7253 1.2699 0.4742 1.2487 0.7657 -0.0548 -1.4604
Was I successful?
Do you want another solution?
L(1,:) = L(1,:)*sign(prod(diag(U)));
U(1:n+1:end) = nthroot(Dtarget,n);
A = L*U
A =
0.0052 0.1007 1.7623 0.7457 0.2337
0.4085 1.0351 0.5421 2.0212 0.6587
0.7567 1.9360 0.1143 0.1061 0.1833
0.8062 0.6791 1.5897 0.2229 2.2088
1.7623 0.4045 0.3056 0.0629 0.9404