How can we break a repetitive data?

조회 수: 1 (최근 30일)
MNRNI
MNRNI 2020년 12월 11일
댓글: Image Analyst 2020년 12월 12일
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