LTPDA Toolbox™ | contents | ![]() ![]() |
Parameters can be grouped together into parameter lists (plist).
You can also create parameter lists directly using the following constructor format:
pl = plist('a', 1, 'b', 'hello')
----------- plist 01 ----------- n params: 2 ---- param 1 ---- key: A val: 1 ----------------- ---- param 2 ---- key: B val: 'hello' ----------------- description: --------------------------------
Additional parameters can be appended to an existing parameter list using the append method:
pl = append(pl, 'c', 3) % append a third parameter
----------- plist 01 ----------- n params: 3 ---- param 1 ---- key: A val: 1 ----------------- ---- param 2 ---- key: B val: 'hello' ----------------- ---- param 3 ---- key: C val: 3 ----------------- description: --------------------------------
Accessing the contents of a plist can be achieved in two ways:
p1 = pl.params(1); % get the first parameter val = find(pl, 'b'); % get the value for the second parameter
If the parameter name ('key') is known, then you can use the find method to directly retrieve the value of that parameter.
You can also remove parameters from a parameter list:
pl = remove(pl, 2) % Remove the 2nd parameter in the list pl = remove(pl, 'a') % Remove the parameter with the key 'a'
You can also set parameters contained in a parameter list:
pl1 = plist('a', 1, 'b', 'hello'); pl2 = pset(pl, 'a', 5, 'b', 'ola') % Change the values of the parameter with the keys 'a' and 'b'
Parameter lists can be combined:
pl = combine(pl1, pl2)
![]() |
Parameter Lists | Simulation/modelling | ![]() |
©LTP Team