Alex Sararu
Alex Sararu

Reputation: 33

Matlab Sum of series for the following-> expression

I don't get how to use sum of series for:

enter image description here

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

Answers (1)

flawr
flawr

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

Related Questions