How to plot only 80% of force displacement after peak from experiment data
조회 수: 1 (최근 30일)
이전 댓글 표시
I have force and displacment data from experiment and I would like to plot only 80% of force after the peak force, ( star marked in attached figure). Please help me with suitable idea. I am quite new in matlab.
Thanks in advance
댓글 수: 0
채택된 답변
Ben Mercer
2021년 9월 21일
편집: Ben Mercer
2021년 9월 21일
Hi Rajan,
I would do this via interpolation. Interpolation only works on data for which the independent variable is monotonic, whereas you are looking at a parametric curve which folds back on itself. If you find the location of the peak force, you can truncate the plot to only include the portion of the curve after the peak, then apply interpolation to the truncated segment of your curve.
Try the code below, subbing in your own variable names obviously:
% Find the location and magnitude of the maximum force
[maxForce, idx] = max(force);
% Truncate to just the portion of the curve after the maximum force, which
% will be descending
force_descending = force(idx:end);
displacement_descending = displacement(idx:end);
% Force monotony of the truncated curve (note, unique removes duplicates
% AND sorts)
[force_descending, IA] = unique(force_descending);
displacement_descending = displacement_descending(IA);
% Determine the location of the 80% of maximum force point
force_80 = 0.8 * maxForce;
displacement_80 = interp1(force_descending, displacement_descending, force_80);
% Plot the point on
hold on
plot(displacement_80, force_80, '+', 'displayname', '80% of peak force')
legend
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!