X = (1/(1-exp(-j.*w)))*(sin(1.5.*(w))./sin(w./2))+5*pi*dirac(w);
% This is your problem!
When MATLAB sees a scalar being divided by a matrix, it doesn't make the assumption that you want to perform the operation element-wise, like it does when you multiply a scalar and matrix or when you divide a matrix by a scalar.
x = [4 2];
y = 1/x; % Error because 1/[4 2] isn't interpretable as a matrix operation.