Command:

addFactor (  
char * factorType,
char * name,
double * parameters,
char * notes
)

What:

Adds a new factor to the configuration to be used for the sample generation

Parameters:

factorType
[char*]
defines the distribution associated with the factor, it can assume one of the following values (see the dedicated distribution command for more info):

  • "normal"
  • "lognormal"
  • "uniform"
  • "piecewise uniform"
  • "loguniform"
  • "piecewise loguniform"
  • "weibull"
  • "constant"
  • "exponential"
  • "gamma"
  • "beta"
  • "triangular"
  • "discrete"
name
[char*]
defines the factor's name. It must begin with a letter and can contain only letters and numbers, this parameter cannot be null!
parameters
[array of double*]
such an array stores the arguments that define the selected distribution, see the command correspondent to each distribution for the detailed description of arguments
note
[char*]
the factor note is optional in Matlab

Return:

error_code [int]: 1 if the operation has occurred without errors, 0 if an error has occurred

Warnings:

If the command is called after a Stein correlation is set, the correlation is discarded

Examples:

addFactor('normal', 'fac1', [49, 1, 0.001, 0.999], 'fac1note')

this command creates a new factor called fac1 with a gaussian distribution which parameters mu and sigma respectively are 49 and 1 while the distribution is truncated before 0.001 and after 0.999

All Factor Commands: