Reputation: 33
I don't get how to use sum of series for:
I have to compute t
number of the sum of series, so just don't care about the character t
there. My elements are from a matrix.
Upvotes: 0
Views: 61
Reputation: 11628
You can use following commands (assuming the input vector is x
):
x = rand(1,100);
y = sum(diff(x).^2);
The diff
calculates the differences-vector of the neighboring entries of x
, which is then squared and summed.
Upvotes: 2