Summation with (Dependent summation)
Show older comments
I need to write a code in Matlab for the following equation:
Σ i=0 to 100 ( (f(x). Σ j=0 to k f(y) )
where f(x), f(y) and k returns constant values. I have tried to write this code. Kindly tell me if this code is logically correct or if we can avoid loops; it would be better.
fx=0.08092;
fy=0.01932;
k=300
YY1 = [];
sum2=0;
for i=1:100
Y2 = [];
for j=1:k
Y1=sum(f2);
end
Y2=sum(f1*Y1)
YY1 = [YY1 Y2];
end
Final=sum(YY1)
Accepted Answer
More Answers (1)
Usman Khalid
on 13 May 2013
0 votes
Categories
Find more on Matrix Indexing 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!