t=[0:0.01:10];
x=(2-exp(-2*t));
plot(t,x);
xlabel('t');
ylabel('x(t)');
title('x(t)=(2-exp(-2*t)');
grid on
t=-2:0.02:2;
f1=(2-exp(-2*t)).*heaviside(t);
plot(t,f1);
xlabel('t');ylabel('(2-e^(-2t))u(t)');
title('(2-e^(-2t))u(t)');
楼上错误,同求答案
t=0:10;
f=(2-e.*(12*t))*u;