The loop will be written in Matlab.
Simply setting the years' range will allow the for loop to run its course and complete the task. To allow the loop to iterate from 1 to the number of years, we add the expression 1:number years.
function savingsBalance = CalculateBalance(numberYears,savingsBalance)
% numberYears: Number of years that interest is applied to savings
% savingsBalance: Initial savings in dollars
interestRate = 0.025;
% 2.5 percent annual interest rate
% Complete the for loop to iterate from 1 to numberYears (inclusive)
for n = 1:numberYears
savingsBalance = savingsBalance + (savingsBalance * interestRate);
end
end
Read more about Matlab on:
https://brainly.com/question/15071644
#SPJ4