\int_{-\infty}^{\infty}e^{-x^{2}}\;dx=\sqrt{\pi}
Just trying my jsTeXrender
t = -5:0.01:5; % total range of the graph q1 = t<-4; % range 1q2 = t>=-4 & t<3; % range 2q3 = t>=3; % range 3 y = zeros(size(t)); % initialization y(q1) = 0; % curve 1 y(q2) = t(q2) + 2; % curve 2 y(q3) = t(q3) - 2; % curve 3 plot(t,y); axis([-5 5 -4 7])
x(t) = 4u(t) + 2sin(3t)inline function is convenient for creating unit step function.t = -pi:0.01:pi;
u = inline('t >= 0');
y = 4*u(t) + 2*sin(3*t);
plot(t,y,'r');grid on;
axis([-4 4 -3 7]);
xlabel('t'); ylabel('x(t)');
title('x(t) = 4u(t) + 2sin(3t)')
clear all;
x = [0 0 -1 2 3 -2 0 1 0 0];
dtx = -2:7; % non-zero range of x
y = [1 -1 2 4];
dty = 8:11; % non-zero range of y
z = conv(x,y);
dtz = 6:18; % non-zero range of z
% plotting
dt = -2:20;
subplot(311);stem(dt,[x zeros(size(8:20))]);
title('Signal A');
subplot(312);stem(dt,[zeros(size(-2:7)) ...
y zeros(size(12:20))]);
title('Signal B');
subplot(313);stem(dt,[zeros(size(-2:5)) ...
z zeros(size(19:20))]);
title('A * B');