Truncating Y values during integration to integrate only the "peaks" or delete CERTAIN elements from a matrix
조회 수: 4 (최근 30일)
이전 댓글 표시
I have a load of data from a force transducer output. The data is in the form of time vs volts.
TEXT=fopen('Test 5.txt','rt');
texta=textscan(TEXT,'%f%f','CommentStyle','"');
A=texta{1};
B=texta{2};
C=[A,B];
D=C;
plot(D)

The first part of my script removes the -ve values, as this relates to the compression wave recoiling in the force transducer and doesn't actually relate to compressive forces at all.
C(C<0)=0;
plot(C)

So far so good.
I am measuring the peak impulse above a certain range — impulse being the integral of force*time (or volts*time in this instance as the transducer outputs a voltage and I haven't included the conversion yet).
To measure the peak impulse I only need the values above a certain range, say 1.

I have tried to simply make a conditional statement to remove all data less than 1:
E=C;
E(E<1)=0;
plot(E)

However, this is not correct as what I am after is more like this (edited on MS paint):

Does anyone have any ideas on how I can, either:
- Limit the Y values used to numerically integrate the data i.e ymin=1
- Remove the data in such a fashion as to resemble the final image above?
Any help would be appreciated!!! Mark.
EDIT:
Please note that I cannot simply state that E(E<1)=1 as this would artificially inflate the integral. I need all the data below that point to basically disappear.
댓글 수: 0
답변 (1개)
Azzi Abdelmalek
2013년 11월 18일
findpeaks(y,'minpeakheight',1)
댓글 수: 3
Azzi Abdelmalek
2013년 11월 18일
편집: Azzi Abdelmalek
2013년 11월 18일
[x_peak,x_location]=findpeaks(y,'minpeakheight',1)
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
