Dear friends,
I have the following array, but I would like to do with a matrix but to start, It will be enough to see the results.
imput :
I can not put a shorter array because I need to check before in long ones.
First of all, I fix two values, a = min value, b = max value After that, I fix c as the number of consecutive values I want to consider.
So, taking into account above, I would have to loop through the array or whatever, to save a new array , which has the start from the c consecutive values between these two max and min restrictions.
To put an example, I have the following: a = 25 max value b = 15 min value c = 4 number of elements which satisfy conditions , that should be consecutive
321321 233321546121321516321215231232316435465312652155212121512010090503025 ->satisfies20 ->satisfies18 ->satisfies15 ->satisfies 14121610489
and the output should be the following:
25 20 18 15 14 12 16 10 4 8 9
and I would save a new array with this ouput. It should not take care if there is a value higher than the previous one, being the main condition, that have to be consecutives.
In the file, there is some NaN rows, so, It would be good if the solution skips this values. If anyone could give me the solution with the file I uploaded would be more than valuable. Because I need to test it in real data.
I hope to have been enough clear in my explanation.
Any help is welcome.
Best Answer