Info

この質問は閉じられています。 編集または回答するには再度開いてください。

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

1 回表示 (過去 30 日間)
Mustahsan Majeed
Mustahsan Majeed 2016 年 2 月 15 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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

回答 (1 件)

Image Analyst
Image Analyst 2016 年 2 月 21 日
Try this:
totalTimeActuatorOn = sum(yourSignal < 100);
  1 件のコメント
Mustahsan Majeed
Mustahsan Majeed 2016 年 2 月 22 日
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

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by