Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Epoch names (\"Pre-3000 B.C.\", etc.) are stored in epochs, a 16 times 1 cell ar

ID: 3837024 • Letter: E

Question

Epoch names ("Pre-3000 B.C.", etc.) are stored in epochs, a 16 times 1 cell array. Complete the following FOR loop, designed to create a table body whose two columns are a) the epoch names and b) the total number of people counted in each epoch. For totals, use the values in your newly-created third column of counts (as described in Prob. 23a). In addition, use the loop body to compute a running total of the number of people counted in each epoch. Be sure to properly initialize total. for k - 1:length(epochs) fprintf(%15s%10d ', , ) total = +; end

Explanation / Answer

total = 0; %initialization
for k = 1:length(epochs)
fprintf('%15s%10d ', epochs{k,1}, counts{k,3})
total = total + count{k,3};
end

The above is the matlab code.

If you face any issues, do let me know the description for counts variable as mentioned in the solution of problem 23a. Hope this helps.