this is my code and I need your help I couldn't figure out where I'm making mistake.
function theSum = triangle_wave(n)t = linspace(0, 4*pi, 1001);for tIndex = 1 : length(t) this_t = t(tIndex); k = 1 : n; numerator = ((-1)^k).*sin(this_t * (2*k+1)); denominator = (2 * k + 1)^2; theSum(tIndex) = sum(numerator ./ denominator);end
Best Answer