05-10-2012 06:31 AM
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.
05-10-2012 06:51 AM
OpenG toolkit has a function called "Boolean Trigger" that can help you.
here's how it works.
hope this helps
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
05-10-2012 06:53 AM
It looks bit challenging I have tried an Example but am not sure how good it works.
Good Luck
05-10-2012 07:04 AM
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?
05-10-2012 07:13 AM
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.$
good luck
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
05-10-2012 07:15 AM
If you only care about actual transitions and not the type of them, I'm a fan of the simple XOR.
05-10-2012 07:21 AM
Yes I have tested the one before now I have tested it I guess this should work. Check it.
05-10-2012 07:26 AM - edited 05-10-2012 07:33 AM
Quite simple.
Norbert
EDIT: Hehe, just seen that it is indeed very comparable to crossrulz' approach 😉
EDIT 2: Adding improved example