bnddury function / Financial toolbox

3 visualizzazioni (ultimi 30 giorni)
Aleksandar
Aleksandar il 20 Ott 2013
Risposto: Image Analyst il 20 Ott 2013
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)?

Risposta accettata

Image Analyst
Image Analyst il 20 Ott 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/

Più risposte (0)

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by