MATLAB: How do i fix this error:Unable to perform assignment because the left and right sides have a different number of elements. i know that it is because i have an array and i’m attempting to turn that into a scalar. i simply don’t know how to fix it.

unbalanced problemvector to scalar

syms n
t=input('Enter a value for time: ');
W = zeros(size(t)) ;
for i = 1:length(t)
W(i) = symsum((4/n*pi)*sin(n*t),n,1,t(i)) ;
end
plot(k,W),grid

Best Answer

      W(i) = symsum((4/n*pi)*sin(n*t(i)),n,1,t(i)) ;
Related Question