Group data in one table to analyze data by set intervals in another table
Show older comments
Hello all,
I would like to create a script that would perform different statistical calculation on one table based on ranges given in another table.
Table A has two columns that include the intervals ("Start" in the first column and "Finish" in the second column). The number of rows of Start-Finish intervals can vary, based on data to be analyzed in the second table). Example of the first table (Table A):
Start Finish
80.6 82
106.5 108.9
134.2 136.5
157.2 159.6
201.3 205.2
...
I would like to create a script that would perform different statistical calculation on the second table (Table B) based on ranges given in Table A, e.g. analyze "Data1", "Data2", "Data3", "Data4" by looking up the ranges within "length" column. The example of the second table (Table B) is as follows :
Length,Data1,Data2,Data3,Data4
...
144.135,0.00,103.00,100.00,68.00,0.00
144.137,0.00,104.00,100.00,67.00,0.00
144.140,0.00,105.00,100.00,67.00,0.00
144.142,0.00,107.00,100.00,67.00,0.00
144.145,0.00,108.00,100.00,66.00,0.00
144.202,0.00,165.00,69.00,52.00,0.00
144.205,0.00,176.00,83.00,51.00,0.00
...
Table B can include as much as few millions of rows with data.
So, in the end, I would like to be able to make a table that would look like Table C below (example) with added columns of calculated statistics for given intervals:
Start Finish Data1SNR Data2SNR Data3Mean Data4Mean Data1STD ...ect
80.6 82
106.5 108.9
134.2 136.5
157.2 159.6
201.3 205.2
...
This seems to be a simple task, and I am beginning to learn Matlab, so I would greatly appreciate your help. Thanks.
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!