bnddury function / Financial toolbox

5 views (last 30 days)
If I set the following: Yield=0.11245;CouponRate=0.175;Settle='04-Apr-12';Maturity='04-Oct-13';Period=12;Basis=0;... EndMonthRule=1;IssueDate='04-Apr-12';FirstCouponDate='04-Oct-13';LastCouponDate='04-Oct-13';... StartDate='04-Apr-12';Face=10654.48;
[ModDuration, YearDuration, PerDuration] = bnddury(Yield,CouponRate, Settle, Maturity,... Period, Basis, EndMonthRule,IssueDate,FirstCouponDate,LastCouponDate,StartDate,Face)
I get the following answer (quote): ??? Undefined function or variable "CFMQDates".
Error in ==> cfamounts at 739 CFMask = CFMQDates(Ind,:) <= Settle(Ind, ones(1,size(CFMQDates,2)));
Error in ==> bnddury at 187 [CFlowAmounts, ~, TFactors] = cfamounts(CouponRate, Settle, Maturity, varargin{:});
Error in ==> MyDurr at 28 [ModDuration, YearDuration, PerDuration] = bnddury(Yield,CouponRate, Settle, Maturity,...
(unquote)
If I set Period=0 than it is okay. What is the problem there? Can it be debugged (try and catch possibly)?

Accepted Answer

Image Analyst
Image Analyst on 20 Oct 2013
Well it looks like CFMQDates has not been assigned to anything before you attempt to use it. Of course it can be debugged. Set a breakpoint and then use F10 to step on/over lines/functions and F11 to step inside functions. For more debugging help, go here: http://blogs.mathworks.com/videos/2012/07/03/debugging-in-matlab/

More Answers (0)

Categories

Find more on Thermodynamics and Heat Transfer in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!