MATLAB: Sum of first 100 integers

homeworksum

Write a script that uses a for loop to calculate the sum of the first 100 integer numbers

Best Answer

my_sum = 0;
for ii = 1:100
my_sum = my_sum + ii;
end
Related Question