| 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' ----------------- --------------------------------
Appending parameters to a parameter list.
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 ----------------- --------------------------------
Finding parameters in a parameter list.
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 parameterIf the parameter name ('key') is known, then you can use the find method to directly retrieve the value of that parameter.
Removing parameters from a parameter list.
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'
Combining multiple parameter lists.
Parameter lists can be combined:
If pl1 and pl2 contain a parameter with the same key name, the output plist contains a parameter with that name but with the value from the first parameter list input.>> pl = combine(pl1, pl2)
|
Creating Parameters | Spectral Windows | ![]() |
©LTP Team