IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
data_split_sgs.m
Go to the documentation of this file.
1 %>@ingroup datasettools
2 %> @file
3 %> @brief Splits data using SGS. Returns an array of structures.
4 %>
5 %> Utilizes the maps issued by the @ref sgs object as row maps to split the dataset
6 
7 %> @param data @ref irdata object
8 %> @param sgs @ref sgs object
9 %>
10 %> @return <em>[pieces]</em> or <em>[pieces, map]</em>. @c pieces: array of irdata objects; @c map cell array of vectors containing the
11 %> indexes of the rows in the original dataset that went to each element of piece.
12 function varargout = data_split_sgs(data, sgs)
13 
14 obsmaps = sgs.get_obsidxs(data);
15 
16 out = data.split_map(obsmaps);
17 
18 if nargout == 1
19  varargout = {out};
20 else
21  varargout = {out, obsmaps};
22 end;
Base Sub-dataset Generation Specification (SGS) class.
Definition: sgs.m:6
Dataset class.
Definition: irdata.m:30
Analysis Session (AS) base class.
Definition: as.m:6
function data_split_sgs(in data, in sgs)