finding an area under a graph

3 views (last 30 days)
A Poyser
A Poyser on 26 Feb 2025
Moved: Matt J on 26 Feb 2025
I want to know the area under a graph.
%
opts = spreadsheetImportOptions("NumVariables", 5);
% Specify sheet and range
opts.Sheet = "Sheet1";
opts.DataRange = "AG4:AK206";
% Specify column names and types
opts.VariableNames = ["PressureMpa6", "PoreDiameter_nm_6", "CumulativePoreVolume_mL_g_6", "SmoothedDV_dlogDPoreVolume_mL_g_6", "x_OfTotalIntrusionVolume6"];
opts.VariableTypes = ["double", "double", "double", "double", "double"];
% Import the data
mean = readtable("/mean.xlsx", opts, "UseExcel", false)
mean = 203x5 table
PressureMpa6 PoreDiameter_nm_6 CumulativePoreVolume_mL_g_6 SmoothedDV_dlogDPoreVolume_mL_g_6 x_OfTotalIntrusionVolume6 ____________ _________________ ___________________________ _________________________________ _________________________ 0.001898 5.4695e+05 9.0337e-31 0.016599 1.3131e-27 0.011365 1.8866e+05 0.006053 0.0072507 8.4375 0.020434 98501 0.0069119 0.0031069 9.6935 0.032421 44120 0.0082659 0.0040477 11.606 0.044323 29301 0.0089894 0.0038466 12.664 0.05591 22128 0.0094183 0.0037759 13.287 0.067954 17693 0.0098767 0.0041917 13.912 0.079652 14780 0.01016 0.0040742 14.323 0.091521 12695 0.010426 0.0049298 14.73 0.10342 11136 0.010707 0.0057902 15.144 0.11537 9908.5 0.011088 0.0055884 15.696 0.12714 8926.9 0.011289 0.0049494 15.981 0.13882 8123.4 0.011469 0.0048232 16.227 0.15053 7453.5 0.011638 0.0052111 16.472 0.16213 6888.9 0.011846 0.0054966 16.796 0.17398 6398.7 0.012023 0.0057163 17.055
% Clear temporary variables
clear opts2
figure;
semilogx(mean.PoreDiameter_nm_6(1:103),mean.CumulativePoreVolume_mL_g_6(1:103),XDataSource = 'mean.PoreDiameter_nm_6(1:103)',YDataSource = 'mean.CumulativePoreVolume_mL_g_6(1:103)');
linkdata on;
grid on
xlabel("PoreDiameter_nm_6(1:103)");
ylabel("CumulativePoreVolume_mL_g_6(1:103)");
title("CumulativePoreVolume_mL_g_6(1:103) vs PoreDiameter_nm_6(1:103)");
legend("show");
I would like to find the % of the area to the left of on the x axis when compared to the total % of the total area under the graph.
I hope that makes sense as a request.
Thanks in advance.
Alex

Accepted Answer

dpb
dpb on 26 Feb 2025
Moved: Matt J on 26 Feb 2025

More Answers (0)

Products


Release

R2024b

Community Treasure Hunt

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

Start Hunting!