innerProduct = @(x,y) y.*x is a function of two variables, but you are using integral() with it, which is the integral of a function of 1 variable.
It is confusing that you are using functions named x and y but you are using parameter names x and y.
My guess at what you want:
t = linspace(0,4);
y = @(t) heaviside(t)-2*heaviside(t-2)+heaviside(t-4);
x = @(t) (t).*heaviside(t)-2*(t-1).*heaviside(t-1)+2*(t-3).*heaviside(t-3)-(t-4).*heaviside(t-4);
powerSquared = @(t) x(t).^2;
innerProduct = @(t) y(t).*x(t);
inner = integral(powerSquared,0,1)
energy = integral(innerProduct,0,1)
c = inner./energy