l,k, m are just scalar symbolic variables. When you write
for example, it solves the problem
k == 0
What is the solution to that problem? I would bet it is k=0. MATLAB does not know that you actually want it to solve some equation for k.
As well, when you write things like:
cond = L(0) == L0;
cond = g*h == k*(l+m);
cond = g+h == k+l+m;
what happens is MATLAB first creates a variable called cond. Then it creates a variable named cond, overwriting the first one. Finally, it creates a variable named cond for the THIRD time, overwriting the previous version.
What else? I see this:
L = ('Lspan');
t = ('tspan');
That just creates two character vectors. I'm not sure what you think they will do, since then you immediately overwrite them with symbolic variables L and t in the syms command.
So I would seriously suggest you need to read the getting started tutorials, since you seem not to even remotely understand how a language like MATLAB works. You are creating things, then immediately overwriting them. You are assuming that MATLAB will know what it is you want to do. Read the manual.
If I had to make a wild guess as to what you want to do, it might be that you have three equations, in three unknowns.
syms k l m g h L0 t
L(t) = k*L0*((m/(g*h))+((h-m)/(g*(g-h))*exp(-h*t))+((m-g)/(g*(g-h)))*exp(-g*t))+2*k*l*L0*(1/(g*h)+(exp(-g*t)/(g*(g-h)))-(exp(-h*t)/(h*(g-h))));
eqn(1) = L(0) == L0;
eqn(2) = g*h == k*(l+m);
eqn(3) = g+h == k+l+m;
sol = solve(eqn,l,k,m)
struct with fields:
l: [2×1 sym]
k: [2×1 sym]
m: [2×1 sym]
g + h
So there are two solutions apparently. Again, it is just a wild guess.