small exercise in Matlab calculates the discount amount and net cost of
discount commercial paper. You must provide the future value of the
discount rate and the number of days to maturity.
formulas used to calculate the discount and cost are as follows:
total future value
number of days to maturity
create a Matlab function to calculate the formulas above:
function [d1, c]
d1 = t *
d/100 * n/360;
c = t -
We can create another
script to test and drive the above
clear; close all; format bank; format compact
future value: ');
discount rate: ');
number of days to maturity: ');
[d, c] =
commercial_paper(t, d, n)
Corporation purchases a $625,000 comm. paper due in 60
days at 5.4%.
What's the discount and cost?
our driving code and enter:
future value: 625000
discount rate: 5.4
number of days to maturity: 60
d = 5625.00
c = 619375.00
'Commercial Paper' to home
'Commercial Paper' to 'Finance Formulas'