Sawtooth Wave Fourier Series- MATLAB issue
It seems we are missing some of your code (e.g. how is capital X defined?). However, your guess is correct. There is an inherent issue with the k.*t operation in line seven. Namely, k has 201 elements (all integers from -100 to 100), while t is defined as 100 elements from 0 to 5 (default for linspace is to produce 100 elements). Thus you are attempting to multiply a (1×201) with a (1×100) matrix. 

I am assuming the equation you have listed above is a summation of k values from -inf to inf, and you are providing an approximation with a relatively large but finite range of k from -100 to 100. One solution is to iteratively sum x100 for each value of k with a for loop. You must redefine x according to the value of k in the for loop. The iterating value k is listed in the code as ki. This script should produce the sawtooth wave you are hoping for. Best of luck!

k = -100:100;
t = linspace(0, 5);
x100 = zeros(1,length(t));
for ki = k
   x = (2*1i)./(pi*ki);
   x100 = x100 + x.*((-1).^ki).*exp(1i*pi*ki.*t);
end
tmin = min(t);
tmax = max(t);
plot(t,x100);