MATLAB: How to represent the mathematical parameter in matlab

mathematicsMATLAB

Here,
how to write the summation and its limits in matlab.

Best Answer

Is this a question about a symbolic computation, or a numerical one?
x = randn(100,1);
% sum of x for elements 10 to 30
sum(x(20:30))
Symbolic
syms k
% sum of k from k =1 to k= 10
symsum(k,1,10)