Hello every body. i want to write this nested sigma in MATLAB . Help is hugely appreciated, thanks. :-)

 Accepted Answer

sum=0.0;
for h=2:25
for j=1:3
for i=1:4
sum=sum+(X(i,j,h)-X(i,j,h-1))^2;
end
end
end
So you will have to shift h by 1 in order not to access X(i,j,0).
Best wishes
Torsten.

2 Comments

Thanks alot Torsten. should i define X as a function? because here X is a variable which has there value, suppose as a point position in Polar coordinates.would you mind present your idea about this. appreciate Torsten
Please do not name a variable "sum", as that interferes with the MATLAB function "sum"

Sign in to comment.

More Answers (0)

Categories

Asked:

on 27 Jul 2015

Commented:

on 27 Jul 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!