b = [2  5  7  4  9  8  3];
c = [2  3  5  7];
sum1 = 0;
for k = 1:4
   sum1 = sum1+b(c(k));
end
sum1