Must be done in Matlab! in other words becomes infinite when I becomes infinite.
ID: 3597090 • Letter: M
Question
Must be done in Matlab!
in other words becomes infinite when I becomes infinite. Let's check that out. First write Matlab code that performs the sum up to I, where at first you take I to be 10 Next put that summation process inside an "outer for" loop on I where you take I to be the successive values [10, 100, 1000, 10000, 100000]. After studying the values you get for the sum using these five I values, use disp to comment on whether it looks like the sum converges to a definite value when I becomes bigger and bigger, or whether it looks like the value seems to keep getting bigger and bigger Note: Summing 100,000 terms may be a bit slow on some computers. You may want to wait with that one until everything works OKExplanation / Answer
I = 1;
for n = 1:5
sum1 = 0;
I = I * 10;
for i = 1:I
sum1 = sum1 + 1/i;
end
fprintf('I = %d, sum=%d ', I, sum1)
end
disp "It looks like the value is getting bigger and bigger with increasing I"
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.