Nt end mybalance10005121 10512e003 formatbank mattbal

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: kets = [0 7300 29700 71950 150150 326450]; taxrate = [0 10 15 25 28 33 35]; difftaxrates = taxrate(2:length(taxrate))-taxrate(1:length(taxrate)1); incomeLevels = income - brackets; incomeToBeCounted = incomeLevels > 0.0; incomeLevels = incomeToBeCounted.*incomeLevels; taxes = incomeLevels.*difftaxrates/100; tax = sum(taxes); fprintf('Your tax on income of $%10.2f is $%10.2f\n', income, tax) Homework
discussion
 function [ A ] = mybalance( P,r,n,t ) %balamce computes the balance of an % interest bearing account after t years % compounded n times a year at interest r % starting with initial amount P r = r/100; A = P*(1+r/n).^(n.*t); End >>
mybalance(1000,5,12,1)
 

1.0512e+003
 >>
format
bank
 >>
mat
=
[
t'
bal']
 mat
=
 









1.00





10511.62
 









2.00





11049.41
 









3.00





11614.72
 









4.00





12208.95
 









5.00





12833.59
 









6.00





13490.18
 









7.00





14180.36
 





...
View Full Document

Ask a homework question - tutors are online