X = sens_struct(data,fs,depid,type)  %Matlab & Octave for regularly sampled data
%    or
X = sens_struct(data,T,depid,type)   %Matlab & Octave for irregularly sampled data
%    or
X = sens_struct(data,fs,depid,type,name)  %Matlab & Octave for regularly sampled data
%    or
X = sens_struct(data,T,depid,type,name)   %Matlab & Octave for irregularly sampled data

#R to do

Generate a sensor structure from a sensor data vector or matrix.

Input var Description Default
data is a vector or matrix of sensor data. This can be in any unit and frame but the metadata generated by sens_struct assumes a default unit and frame. Change these manually in X after running sens_struct to the correct unit and frame.N/A
fs is the sampling rate of the sensor data in Hz (samples per second).N/A
T is the time in seconds of each measurement in data for irregularly sampled data. The time reference (i.e., the 0 time) should be with respect to the start time of the deployment. N/A
depidis a string containing the deployment identifier for these data.N/A
typetype is a string containing the first few letters of the sensor type, e.g., acc for acceleration. These will be matched to the list of sensor names in the sensor_names.csv file. If more than one sensor matches type, a warning will be given. type can be in upper or lower case.N/A
nameis the optional name to give the variable, e.g., T_EXT. If a name is not given, a default value will be selected.N/A
Output var Description Units
Xis a sensor structure with metadata fields pre-populated from the sensor_names.csv file. Change these as needed to the correct values. N/A

### Matlab & Octave

A = sens_struct(Aw,fs,'md13_134a','acc')
A.frame = 'animal' ;     % change frame indication

### R

# to do