MATLAB: Problem plotting a function

errorplotting

I am having problem plotting the function. When I try to run the code it says "Error using plot Data must be numeric, datetime, duration or an array convertible to double."
syms w;
X = (2*w + 3).*(heaviside(w+6)-heaviside(w+4));
X = X + ((-2*w - 1).*(heaviside(w+4)-heaviside(w+2)));
w = -10:10;
plot(w, X)

Best Answer

plot(w, subs(X))