A matlab function is not running. Can someone help me?
Afficher commentaires plus anciens
Hello evreone, I am trying to run this code, but I get this error:' Invalid expression. Check for missing or extra characters.'
The error isn't the code but the funcion " mertonmodel" because I can't even run the code showed into the documentation (https://it.mathworks.com/help/risk/mertonbytimeseries.html)
I tried to reinstall the matlab license and I have already checked the the tools.
What's strange for me is the fact that the function "mertonByTimeSeries " that is from the same ToolBox is working.
Can someone explain me how to proceed? Or maybe you can see if with my code is working with your matlab and show me the plot: plot(Equity, PD).
Thankyou in advance.
EquityVol2 = 0.198;
Liability2 = 66.547;
Rate2 = 0.009;
Maturity2 = 5;
Equity2=7000/10000;
EquityVol = zeros(1,10000);
Liability = zeros(1,10000);
Rate = zeros(1,10000);
Maturity = zeros(1,10000);
Equity=zeros(1,10000);
EquityVol(:) = EquityVol2;
Liability(:) = Liability2;
Rate(:) = Rate2;
Maturity(:) = Maturity2;
Equity(1)=Equity2;
for i=2:size(Equity,2)
Equity(i)=Equity(i-1)+Equity2;
end
[PD,DD,A,Sa] = mertonmodel(Equity,EquityVol,Liability,Rate,'Maturity',Maturity);
plot(Equity, PD)
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur MATLAB Coder dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
