The solution is a symbolic expression. What you need is substitution in symbolic expressions and plotting of symbolic expressions. A quick search on the Matlab website gives subs
and ezplot
as suitable functions. I fixed the code but please check the working of those two functions either on the web or in your Matlab.
H=1;
k=1;
c=0.1;
tau0=1;
a1=k*H*H/c;
a0=-H*H*tau0/c;
sol=dsolve('D2th=a1*th+a0','th(0)=0','th(1)=0','t');
sol2 = subs(sol, [sym('a0'),sym('a1')], [a0, a1]);
t0=0;
tf=1;
ezplot(sol2, [t0, tf]);