Define the eements of the matrices in terms of symbolic unknowns. Then use solve to determine the unknown elements. Note that unless there are EXACTLY n^2 unknown elements remaining between the matrices L and U, your call to solve must fail.
Note: I can probably do this more efficiently, but...
L = tril(sym('L',[3,3]))
L =

U = triu(sym('U',[3,3]))
U =

U = U + diag([1 2 3]) - diag(diag(U))
U =

So I have created unknown matrices L and U. I've arbitrarily set the diagonal elements of U to the numbers 1,2, and 3.
Now, can we solve for the remaining unknowns, such that L*U = A?
syms L1_1 L2_1 L3_1 L2_2 L3_2 L3_3 U1_2 U1_3 U2_3
LUparams = solve(L*U == A)
LUparams =
L1_1: [1×1 sym]
L2_1: [1×1 sym]
L2_2: [1×1 sym]
L3_1: [1×1 sym]
L3_2: [1×1 sym]
L3_3: [1×1 sym]
U1_2: [1×1 sym]
U1_3: [1×1 sym]
U2_3: [1×1 sym]
L = subs(L,LUparams)
L =

U = subs(U,LUparams)
U =

Was I successful?
L*U - A
ans =

Look at that. I got lucky.