Extracting data from a matrix of unknown size
2 views (last 30 days)
Show older comments
Robert
on 11 Feb 2016
Answered: Walter Roberson
on 11 Feb 2016
I have created a matrix "Intervals" from an acceleration signal. The matrix contains time stamps of intervals that I want to extract from the full signal output, based on characteristics of the signal. Column 1 is the start point for each interval, Column 2 is the end point.
Intervals=
28868 44034
48111 66203
69134 87427
90604 94399
97422 101333
104292 108044
111269 114862
120068 137008
So, for example I want to create a new matrix called "Interval_1" and this first interval goes from samples 28868:44034. "Interval 2" will be from 48111:66203 and so on. I will use these intervals to chop up my original signal for further analysis.
My problem is that I won't know how large my Intervals matrix will be - it will always contain 2 columns but may have any number of rows depending on the original signal.
So I am looking for a way of extracting each row's values and assigning them to "Interval_1, Interval_2, ..., Interval_N, where N is the number of rows.
I am trying to do this with for loops but with no joy as yet.
Thanks for your help, Robert
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Matrix Indexing 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!