LTPDA Toolbox™ | contents | ![]() ![]() |
Parameters can be grouped together into parameter lists (plist).
The following code shows how to create a parameter list from individual parameters.
>> p1 = param('a', 1); % create first parameter >> p2 = param('b', specwin('Hanning', 100)); % create second parameter >> pl = plist([p1 p2]) % create parameter list ----------- plist 01 ----------- n params: 2 ---- param 1 ---- key: A val: 1 ----------------- ---- param 2 ---- key: B val: specwin -------- Hanning ------------ alpha: 0 psll: 31.5 rov: 50 nenbw: 1.5 w3db: 1.4382 flatness: -1.4236 ws: 50 ws2: 37.5 win: 100 ----------------------------- ----------------- --------------------------------
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' ----------------- --------------------------------
Additional parameters can be appended to an existing parameter list using the append method:
>> pl = append(pl, param('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 ----------------- --------------------------------
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 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:
>> pl = plist('a', 1, 'b', 'hello') >> pl = 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)
![]() |
Constructor examples of the TIMESPAN class | Constructor examples of the SPECWIN class | ![]() |
©LTP Team