How to find the x value corresponding to the half of a curve?
Show older comments
Can anyone help out with the Matlab codes necessary to determine the a, b (y axis) and c (x axis) values in the following graph? Thanks.
Answers (1)
Andrei Bobrov
on 21 Nov 2013
S - your signal; time1 - time.
[a,ia] = max(S);
l1 = [false;diff(S(1:ia)) < 1];
ib = find(l1,1,'last');
b = S(ib);
Csig = (a+b)/2;
Sab = S(ib:ia);
t = time1(ib:ia);
ii = find(Sab < Csig,1,'last');
C = interp1(Sab([ii,ii+1]),t([ii,ii+1]),Csig);
Categories
Find more on Curve Fitting Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!