LTPDA Toolbox™ | contents | ![]() ![]() |
Collection objects serve as merely a wrapper for a cell-array of LTPDA User Objects. The point of this is to provide a way to put together user objects of different classes in to a collection which can be saved/loaded/submitted/retrieved, etc.
You can create a collection object like:
>> c = collection ---- collection 1 ---- name: num objs: 0 description: UUID: 158008c6-5759-415f-b5ae-35a0da984e9f ----------------------
>> c.addObjects(ao(1)) ---- collection 1 ---- name: num objs: 1 [01] obj1: ao | /cdata Ndata=[1x1], yunits= description: UUID: fc0fb4af-594c-4729-95e7-8bc95eff894f ----------------------
>> c.addObjects(pzmodel(1, 10, 100), mfir()) ---- collection 1 ---- name: num objs: 3 [01] obj1: ao | /cdata Ndata=[1x1], yunits= [02] obj1_1: pzmodel | pzmodel(g:0.1 p:-62.8319 z:-628.3185) [03] obj2: mfir | (fs=, ntaps=0.00, a=[]) description: UUID: b47b05f5-7b64-4908-9a96-f5ac25276937 ----------------------
The elements of a collection can be named, for instance when building it:
names = {'a', 'b', 'c'}; objs = {a, b, c}; c2 = collection(plist('objs', objs, 'names', names))
Or, in an equivalent fashion:
c3 = collection(a, 'a', b, 'b'); c4 = collection(a, b, plist('names', {'a', 'b'}));
You can then extract objects from the collection by:
Since a collection object is an LTPDA User Object, it has history tracking capabilities. That means that everytime you
add or remove an object to/from the collection, a history step is added. For example, the history of our collection above looks like:
![]() |
Plotting Analysis Objects | Units in LTPDA | ![]() |
©LTP Team