How to plot only 80% of force displacement after peak from experiment data

3 visualizzazioni (ultimi 30 giorni)
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

Risposta accettata

Ben Mercer
Ben Mercer il 21 Set 2021
Modificato: Ben Mercer il 21 Set 2021
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

Più risposte (0)

Categorie

Scopri di più su MATLAB in Help Center e File Exchange

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by