However, I am having issues with representing it in MATLAB. I keep receiving an error message saying "Matrix dimensions must agree. Error in problem1_plot (line 7) basis = ((-1).^k).exp(jpi*k.*t);"
I tried looking at each part of the basis, and it seems the problem lies within the exp term. When I tried to run my code with only that part of the basis in, the same error message popped up. I'd appreciate any help in clarifying what the cause of this issue is.
t = linspace(0, 5); k = -100:100; x = (2*j)./(pi*k); xm = repmat(X ,[1, length(t)]); basis = ((-1).^k).*exp(j*pi*k.*t); x100 = sum(xm.*basis); tmin = min(t); tmax = max(t); plot(t,x100);