How can i found the infelction point from the data and remove the data before the first and last infelction points.
조회 수: 1 (최근 30일)
이전 댓글 표시
I need to find the inflection point from the experimental data using matlab. Kindly help me for that. Thanks in advance
댓글 수: 0
답변 (2개)
Star Strider
2023년 1월 16일
The data are quite noisy. After filtering them, it is not obvious what sort of inflection point you want or how to define it.
M1 = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1265285/data.xlsx')
x = M1(:,1);
y = M1(:,2);
% yf = sgolayfilt(y, 3, 451);
Fs = 1/mean(diff(x))
Fn = Fs/2;
L = numel(x);
NFFT = 2^nextpow2(L);
FTy = fft((y-mean(y)).*hann(L),NFFT)/L;
Fv = linspace(0, 1, NFFT/2+1)*Fn;
Iv = 1:numel(Fv);
figure
semilogy(Fv, abs(FTy(Iv))*2)
grid
xlim([0 10])
yf = lowpass(y, 0.5, Fs, 'ImpulseResponse','iir');
dyfdx = gradient(yf) ./ gradient(x);
d2yfdx2 = gradient(dyfdx) ./ gradient(x);
figure
yyaxis left
plot(x, y, 'DisplayName','Unfiltered Data')
hold on
plot(x, yf, '-r', 'DisplayName','Filtered Data')
hold off
ylabel('Data')
yyaxis right
plot(x, dyfdx, 'DisplayName','First Derivative Of Filtered Data')
hold on
plot(x, d2yfdx2, 'DisplayName','Second Derivative Of Filtered Data')
hold off
yline(0, '-g')
ylabel('Derivatives')
grid
legend('Location','best')
.
댓글 수: 8
Star Strider
2023년 1월 27일
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.
Steven Lord
2023년 1월 16일
The ischange, islocalmin, and/or islocalmax functions may be of use to you, as might the corresponding Live Editor Tasks Find Change Points and Find Local Extrema.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Time Series에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!