The standard flow looks more or less like this:
syms t s Y
% Find Laplace transform of right-hand side.
RHS = laplace(27*cos(2*t)+6*sin(t));
% Find transforms of first two derivatives using
% initial conditions y(0) = -1 and y'(0) = -2.
Y1 = s*Y + 1;
Y2 = s*Y1 + 2;
sols = solve(2*Y2 + Y1 - Y - RHS, Y);
solt = ilaplace(sols,s,t);
pretty(solt)
fplot(solt,[0,8])
grid on
You can verify that solt is a particular solution of your differential equation. You can also check that it satisfies the initial conditions.
isAlways(2*diff(solt,t,2)+diff(solt,t)-solt == 27*cos(2*t)+6*sin(t)) % ans = 1
subs(solt, t, 0) % ans = -1
subs(diff(solt), t, 0) % ans = -2
Back in the day MATLAB had no support for function handles; an often-used workaround was to pass strings around with expressions to be evaluated, but now this practice is discouraged.