MATLAB: What does the first cash flow value signify when I calculate the cash flows for a bond using cfamounts function in Financial Toolbox 4.1 (R2011b)

bondcashcfamountsFinancial Toolboxflowsnegative

(A) When I am executing the following commands in MATLAB
[C,D,TF,CF,CFP]= cfamounts(0.06,'31-Dec-2011','31-Dec-2014','Period',1,'Basis',1);
[cellstr(datestr(D)),num2cell(C')]
I received the following result:
'31-Dec-2011' [ 0]
'31-Dec-2012' [ 6]
'31-Dec-2013' [ 6]
'31-Dec-2014' [106]
(B) However when I execute the following command:
[C,D,TF,CF,CFP]=cfamounts(0.06,'1-Dec-2011', '31-Dec-2014','Period',1,'Basis',1);
[cellstr (datestr(D)),num2cell(C')]
I receive the following result:
'01-Dec-2011' [-5.5167]
'31-Dec-2011' [ 6]
'31-Dec-2012' [ 6]
'31-Dec-2013' [ 6]
'31-Dec-2014' [ 106]
(C) And when I execute the following command:
[C,D,TF,CF,CFP]= cfamounts(0.06,'1-Jan-2012', '31-Dec-2014','Period',1,'Basis',1);
[cellstr(datestr(D)),num2cell(C')]
I receive the following result:
'01-Jan-2012' [-0.0167]
'31-Dec-2012' [ 6]
'31-Dec-2013' [ 6]
'31-Dec-2014' [ 106]
Why I am receiving the above differences in the first cash flow values, and what do they signify?

Best Answer

The values mentioned in the first cash flows (the first lines in each of the respective results above) are accrued interests. When buying a bond between coupon dates (cash flow dates), you have to pay for the fraction of the coupon that is proportional to the amount of time since the last coupon date which is approximately,
( now - last coupon date) / (next coupon date - last coupon date)
So, in scenario (A) above, the accrued interest is 0 because the settlement date falls on a coupon date (nothing has accrued). In scenario (B), the accrued interest is close to 6, because the settle date ('1-Dec-2011') is almost reaching the next coupon date ('31-Dec-2011'). The number is negative because while you are receiving the coupons (i.e. 6, 6, 106, an incoming cash flow), you need to pay the accrued interest (it is an outgoing cash flow).