MATLAB: How can i calculate in matlab

homeworkmathematics

we borrowed $1000 at a 10% anual intrests rate. if we do not makre a payment for 2 years, and assuming there is no penalty for non payment, how much do we owe now?

Best Answer

simple interest:
1000 + (1000 * 0.1) * 2
compound interest:
1000 + 1000 * 0.1 + (1000 + 1000 * 0.1) * 0.1
or
1000 * (1 + 0.1) ^ 2
as function
simple interest:
function current = simple_interest(debt, rate, period)
current = debt + (debt * rate) * period;
end
compound interest:
function current = compound_interest(debt, rate, period)
current = debt * (1 + rate) ^ period;
end