x = [1 23 43 72 87 56 98 33]summ = 0for k = 1:length(x) summ = summ + x(k)end
MATLAB: Only want last iteration displayed, whereas it continually sums up the array each loop
for loop
for loop
x = [1 23 43 72 87 56 98 33]summ = 0for k = 1:length(x) summ = summ + x(k)end
Best Answer