How can we break a repetitive data?

1 次查看(过去 30 天)
MNRNI
MNRNI 2020-12-11
Let's say we apply current in a repetitive way:
I=-10 for 10 sec
I=0 for 180 sec
I=-5 for 30 sec
I=0 for 180 sec
and repeat it.
Then we get a voltage.
How can we separate this voltage figure into single pulses?
Each pulse is I=-10 followed by I=0.

回答(1 个)

Image Analyst
Image Analyst 2020-12-11
Just do like this (example for the first range):
indexesToExtract = (t >= -10) & (t < 10);
thisPulse1 = completeVoltageSignal(indexesToExtract);
indexesToExtract = (t >= 0) & (t < 180);
thisPulse2 = completeVoltageSignal(indexesToExtract);
indexesToExtract = (t >= -5) & (t < 30);
thisPulse3 = completeVoltageSignal(indexesToExtract);
indexesToExtract = (t >= 0) & (t < 180);
thisPulse4 = completeVoltageSignal(indexesToExtract);
Repeat for any other time ranges.
  2 个评论
MNRNI
MNRNI 2020-12-11
Thanks.
What if we have random time values?
for example:
I=-10 for t1 sec
I=0 for t2 sec
I=-5 for t3 sec
I=0 for t4 sec
Image Analyst
Image Analyst 2020-12-12
Maybe try findchangepts().
Or you could try to get the moving mean with movmean() and then look for points above and below the mean.
If you need more help, attach some data so that we have something to work with.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by