I want to sum up all n*sin(n*x)-terms. I've found that
f = n*sin(n*x)for n = 1:10 f(n+1) = n*sin(n*x);endsum(f)
works. However, in my view it's not that elegant. In other words, how to implement without using 'sum'?
for loopMATLAB
f = n*sin(n*x)for n = 1:10 f(n+1) = n*sin(n*x);endsum(f)
Best Answer