Let’s assume that we have an array of 582 elements. Some of them are above 4 and some of them are below 1,let’s also say that values who are above 4 are equal to True (1) and the values below 1 are equal to False (0). The question is how can I calculate how many transitions are inside the array from 1 to 0?How many peaks I have? Can please someone suggest a code solution for that?
Solved! Go to Solution.
It looks bit challenging I have tried an Example but am not sure how good it works.
P Anand no this not helped., iwant to calculate how many transitions i have from 1 to zero and zero to 1,that's i want to find.i am trying to downloan the toolkit the friend mention to see how it works.Any other solutions please?
The example I gave in my previous post works on an array of boolean, as I understand you have an array of numeric so you'll have to add some threshold value so it works.
What I suggest is that you try to implement it and if it doesn't work exactly as you wish, post it here and we'll help you to fix it.$
We have two ears and one mouth so that we can listen twice as much as we speak.
If you only care about actual transitions and not the type of them, I'm a fan of the simple XOR.
Yes I have tested the one before now I have tested it I guess this should work. Check it.
EDIT: Hehe, just seen that it is indeed very comparable to crossrulz' approach 😉
EDIT 2: Adding improved example