Fill This Form To Receive Instant Help
Homework answers / question archive / Write two nested for loops to calculate the following double summation Sigma^i_i = 1 Sigma^1_j = 1 = ij Ex If s a 3 and t is 2 then summation Result is 18 (1 x 1)+(1 x 2)+(2 x 1)+(2 x 2)+(3 x 1)+(3 x 2) 18 function suaaation Result = Double Sua(s, t) % s: First summation liait (i = 1 to s) % t: Second summation limite (j = 1 to t) summationResult = 0; % Write two nested for loops to calculate the double summation % summationResult = suamstionResult + (1 + j);
Write two nested for loops to calculate the following double summation Sigma^i_i = 1 Sigma^1_j = 1 = ij Ex If s a 3 and t is 2 then summation Result is 18 (1 x 1)+(1 x 2)+(2 x 1)+(2 x 2)+(3 x 1)+(3 x 2) 18 function suaaation Result = Double Sua(s, t) % s: First summation liait (i = 1 to s) % t: Second summation limite (j = 1 to t) summationResult = 0; % Write two nested for loops to calculate the double summation % summationResult = suamstionResult + (1 + j);
Copyable Code:
function summationResult=DoubleSum(s,t)
summationResult=0;
for i=1:s %first summation limit (i= 1 to s)
for j=1:t %second summation limit (j= 1 to t)
summationResult = summationResult +(i*j);
end
end
end
please see the attached file for complete solution