Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

How to find the time a system activates, if it activates several times during one test?

2 vues (au cours des 30 derniers jours)
Mustahsan Majeed
Mustahsan Majeed le 15 Fév 2016
Clôturé : MATLAB Answer Bot le 20 Août 2021
Hello,
I have an actuator that activates several times during my test. So in short 100=off and 100<is on.
So my plot looks something like I have attached.
Now I want to calculate the total time (which is on x-axis)when the system is below 100. This will be the total time that my actuator was on.
Could anyone please advise me on which fiction should I use to get to my result?
Kind Regards, Mustahsan

Réponses (1)

Image Analyst
Image Analyst le 21 Fév 2016
Try this:
totalTimeActuatorOn = sum(yourSignal < 100);
  1 commentaire
Mustahsan Majeed
Mustahsan Majeed le 22 Fév 2016
Thank you very much for your reply!
Yes this will give me the total time but it would be great if i could get duration between two peaks. So then I will know for how long it activates each time.
Thanks!
-Mustahsan

Cette question est clôturée.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by