divide equal parts of a time series into a new matrix

Hi, its a simple question but I'm having problems with the conditions to impose. I have a column of scalonated values (like:1 2 3 1 2 3 1 2 3) along the time,as an input, with its respective responses in other column. Would like to separate each sequence of "123", to have the minimum value of the response of each sequence, and the respective time. I'd appreciate any help. Thanks

 Accepted Answer

So:
[val idx] = min(reshape(A,3,[])); %each val is the respective minimum
idx = idx+(0:3:(3*length(idx)-1)); %original column index.

1 Comment

Thanks Sean, it works fine for finding the indexes at the end, but in the case of treating all 3 columns. In my case, I would like to have the minimum values of each sequence, just for the 3rd column. For example, if I have
T I O
1 1 3
2 2 8
3 3 6
4 1 5
5 2 7
6 3 2
7 1 3
8 2 5
9 3 2
want to have the minimum value of "O" for each sequence 123 of "I". Moreover, I know the limits of the interval of 123, but not the number of points.
Thanks in advance for your help.

Sign in to comment.

More Answers (0)

Categories

Find more on Mathematics in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!