Without knowing the other function it won't be useful to put an answer, but at least the following code plots the single pulse you have defined:
N = 1000; % number of points
Ti = 2; % time interval t in [-L,L]
t = linspace(-Ti,Ti,1000); % the samped time "t"
pxv = zeros(1,N); % pulse function vector x(t)
indt = (t >= 0) & (t <= 1); % select time index for 0 <= t <= 1
pxv( indt ) = t( indt) ; % define x(t) = t , in 0<=t<=1
figure,plot(t,pxv); % PLOT : Note that "t" and "pxv" MUST have same number of samples.
title('function x(t) = t , for 0 \leq t \leq 1');
xlabel(' time t [s]');
The code results in the following plot :