MATLAB: Having problems with integral with variable Bounds

integrationsymbolicvariablevariables

So Im want to have a integral with the upper and lower limits be Variable such as " 't' to 't-4' " and spit out symbolic answer in terms of 't'
syms z;
syms t;
f=@(z) 6-2.*z;
Upper=@(t) t;
Lower=@(t) t-4;
integral(f,Upper,Lower)
Error using integral (line 85)
A and B must be floating-point scalars.

Best Answer

syms z t
f = 6-2.*z;
Upper = t;
Lower = t-4;
int(f, z, Lower, Upper)