bnddury function / Financial toolbox

3 vues (au cours des 30 derniers jours)
Aleksandar
Aleksandar le 20 Oct 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)?

Réponse acceptée

Image Analyst
Image Analyst le 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/

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by