dcrg.struct

Functions

dcrg.struct.bin

dcrg.struct.bin(struct_a, bin_field, out_names)

dcrg.struct.concat

dcrg.struct.concat(S1, S2, varargin)

CONCAT concatonates two structures with disimilar fields S2 is added to the end of S1, if a field in S2 exists in S1 they are combined, otherwise a new field is created (and all the values in S1 are set blank)

created: 11/03/2021 author: Fintan Healy email: fintan.healy@bristol.ac.uk

dcrg.struct.filter

dcrg.struct.filter(DataStruct, filters)

FILTER method to extract a logical array of rows in a data structure which match the filters specified in ‘filters’. This is a cell array where each array isa single filter, hence filters can be combined. each filter is also a cell array and can take a few forms. The first value is always the ‘field’ in the structure to apply the filter on and the second item can either be:

A single value -

{‘mychannel’,5} or {‘mychannel’,’some string’}

An array of possible values -

{‘mychannel’,[5,10]}

A range of values between -

{‘mychannel’,{‘range’,[-2,2]}}

A array of possible string values

{‘mychannel’,{‘contains’,{‘string1’,’string2’}}}

A function that returns a logical array -

{‘mychannel’,@(x)x>5 & x<23} or {‘mychannel’,@(x)contains(x,{‘string1’,’string2’})} etc…

The function will return the filtered structure and the indicies of the filtered components in DataStruct

created: 11/03/2021 author: Fintan Healy email: fintan.healy@bristol.ac.uk

dcrg.struct.merge

dcrg.struct.merge(struct_a, struct_b)

if one of the structres is empty do not merge