Double summation with nested sum
Show older comments

I need to write this in Matlab. I need some help.Thanks in advance.
Accepted Answer
More Answers (1)
Walter Roberson
on 23 Dec 2017
V = @(M) M(:);
part1 = sum(bsxfun( @times, V(x(2:30)), 1:9 ) .* bsxfun(@power, (1:29).'/29, 0:8 ), 2);
part2 = sum(bsxfun( @times, V(x(2:30)), bsxfun(@power, (1:29).'/29, 1:9 )), 2).^2;
part3 = sum((part1 - part2 - 1).^2);
result = part3 + x(1).^2 + (x(2) - x(1).^2 - 1).^2;
Categories
Find more on Time Series Events in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!