MATLAB: How can calculate this formula with matlab
I have the vectors w(1,n) and σ(n,1). How can calculate this formula?
Best Answer
You can pull the w_i and sigma_i outside of the sum_j, because the don't depend on j. And you can compute the sum_j nicely as a matrix multiplication of row vector w and column vector sigma.
Best Answer