# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## is how can I calculate how many transitions are inside an array?

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?

Message 1 of 8
(2,024 Views)

## Re: is how can I calculate how many transitions are inside an array?

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

Antoine Chalons

Message 2 of 8
(2,009 Views)

## Re: is how can I calculate how many transitions are inside an array?

It looks bit challenging I have tried an Example but am not sure how good it works.

Good Luck

-----

The best solution is the one you find it by yourself
Message 3 of 8
(2,007 Views)

## Re: is how can I calculate how many transitions are inside an array?

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?

Message 4 of 8
(1,995 Views)

## Re: is how can I calculate how many transitions are inside an array?

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

Antoine Chalons

Message 5 of 8
(1,988 Views)

## Re: is how can I calculate how many transitions are inside an array?

If you only care about actual transitions and not the type of them, I'm a fan of the simple XOR.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 8
(1,984 Views)
Solution
Accepted by topic author gtathatos

## Re: is how can I calculate how many transitions are inside an array?

Yes I have tested the one before now I have tested it I guess this should work. Check it.

-----

The best solution is the one you find it by yourself
Message 7 of 8
(1,977 Views)

## Re: is how can I calculate how many transitions are inside an array?

Quite simple.

Norbert

EDIT: Hehe, just seen that it is indeed very comparable to crossrulz' approach 😉