MATLAB: How to calculat the sequence

kaMATLABsimulink

Best Answer

u = rand(1,100) ; % data for demo
k = 20 ;
thesum = 0 ;
for j = 1:k-1
thesum = thesum+sqrt(k-j)*u(j) ;
end
You can achieve the same without loop using:
j = 1:k-1 ;
iwant = sum(sqrt(k-j).*u(j))
Related Question