user3616251
user3616251

Reputation: 13

writing the input arguments for a function in matlab

I am using this function on matlab

[ProbData,HazData] = cdsbootstrap(ZeroData,MarketData,Settle,[],[],[],[],[],[],0.25)

and it is giving me an error because it dose not understand the [ ].

I want to keep the default inputs from 4-->9 and change the ninth input to 0.25. What should I put instead of the [ ]?

Upvotes: 1

Views: 192

Answers (1)

Raab70
Raab70

Reputation: 721

The function cdsbootstrap uses matlab's very common Name/Value pair syntax. Read the first few lines here:

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

So if you wanted ALL default values, you would use the call:

[ProbData,HazData] = cdsbootstrap(ZeroData,MarketData,Settle);

If you wanted to change one of these possiblities you would simply include the name and value, all names omitted are set to defaults. Based on your value of 0.25 I'm going to assume you are trying to set the RecoveryRate since 0.25 is close to the default.

[ProbData,HazData] = cdsbootstrap(ZeroData,MarketData,Settle,'RecoveryRate',0.25);

Ref:

http://www.mathworks.com/help/fininst/cdsbootstrap.html

Upvotes: 2

Related Questions