[X,fs] = sens2var(Sx)     % Matlab & Octave regularly sampled data
%    or
[X,T] = sens2var(Sx)      % Matlab & Octave irregularly sampled data
%    or
[X,Y,fs] = sens2var(Sx,Sy); % Matlab & Octave with two variables of regularly sampled data
%    or
[X,Y,T] = sens2var(Sx,Sy);  % Matlab irregularly with two variables of irregularly sampled data

#R to do

Extract data from a sensor structure. If called with two variables, the function checks for compatibility (i.e., same length and sampling). The function can also be called with a trailing string 'regular' to check if the sensor structures are regularly sampled. If not, X will be returned empty.

Input var Description Default
Sx, Sy Sensor data structures. Sx, Sy must be sensor structures. If not X will be returned empty.N/A
r Trailing string variable 'regular', to force the function to check if the sensor data are regularly sampled.N/A
Output var Description Units
X,Yare vectors or matrices of sensor data. These are in the same units and frame as stored in the input sensor structures. N/A
fsis the sampling rate of the sensor data in Hz (samples per second). N/A
Tis the time in seconds of each measurement in data for irregularly sampled data. The time reference (i.e., the 0 time) is with respect to the start time of the data in the sensor structure. N/A

### Matlab & Octave

loadnc('testset3')
[pca_dur,pca_time] = sens2var(PCA);

### R

# to do