Page 1 of 1

Account the number of time that something happen

PostPosted: Wed Feb 11, 2009 1:44 am
by Fermin
Hi, I dont speak english, but I wait that you can understand me. I seek a expression that it account the frequency, the number of times, that something happen, for example, the number of times that the car is in second gear, etc.

I can do this, but I need five expressions by each parameter that I want know the number of times

Example that I do:

A: 'Gear' == 2
B: time_shift('A',0.001) [Rate:1000Hz]
C: max('A' - 'B',0)
D: integrate('C') [Rate:1000Hz]
Nº of time in 2º gear: (stat_max('D') - stat_min('D')) * 1000 [Rate:1000Hz]

I seek something more simple, this way consume many resources of the PC.

Can you help me?

Thanks.

Re: Account the number of time that something happen

PostPosted: Fri Feb 20, 2009 3:12 pm
by OmarK
i2 doesn't have a "count" function that you are looking for yet. I usually export data into excel and perform maths calculations as well as produce summary charts and graphs, maybe this could be an option.

Re: Account the number of time that something happen

PostPosted: Thu Sep 27, 2012 7:00 am
by mangel83
3 years after the original post I wanted to know if the function was included, i.e. to count the number of gearshifts per lap.

Is it possible?

Re: Account the number of time that something happen

PostPosted: Fri Oct 05, 2012 10:05 pm
by Martin
this is how I count
integrate(abs(derivative('Gear')))

Re: Account the number of time that something happen

PostPosted: Sat Feb 02, 2013 2:53 am
by ElectronSpeed
Martin,

I like your solution.

I was having a problem trying to count RISING edges of a pulsed signal. Ultimately, I took your solution and divided by 2.

Eric Schieb