I want to break one long table consisting of 160000 data points into 200 (or other arbitrary number) of 800 (again arbitrary) sample data windows.
Request some help understanding the unstack function and whether this permits specifying the equivalent of "grab the next 800 data samples and move them into a new table column"? It doesn't seem as if 'GroupingVariables' supports this.
I'm not wedded to using a table function to do this, but I repeatedly run into this issue of ingesting a long data series and needing to segregate the points into equally-sized windows. I'm open to any type of solution.
I currently perform this via the following for loop in a clunky manner:
numberofWindows = 200;
numberofPoints = 800;
windowTable = table;
for i=1:numberofWindows
startIndex = (i-1)*numberofPoints*(1-overlap)+1;
stopIndex = startIndex + numberofPoints - 1;
label = strcat(string(data(startIndex,1)),{'-'},string(data(stopIndex,1)));
values2copy = data(startIndex:stopIndex,2);
windowTable(:,i)=array2table(values2copy);
windowTable.Properties.VariableNames{i}=convertStringsToChars(label);
end
Thank you!
0 Comments
Sign in to comment.