MATLAB Answers

Please anyone help me to plot the graph(load against extension) from the raw data(excel) and calculate the area under the graph of it?

7 views (last 30 days)
Matzulk on 9 May 2016
Commented: Star Strider on 11 May 2016
i want to plot the graph that i imported from the excel and calculate the area under the curve

Accepted Answer

Star Strider
Star Strider on 9 May 2016
This should work:
[D,S] = xlsread('Al 1.csv');
Ext = D(:,2);
Load = D(:,3);
AUC = cumtrapz(Ext, Load); % Area Under Curve (Cumulative Integral)
plot(Ext, Load)
hold on
plot(Ext, AUC)
hold off
xlabel('Extension (mm)')
ylabel('Load (kN)')
legend('Data', 'Cumulative Area Under Curve (kN\cdotmm)', 'Location','NW')
text(5, 25, sprintf('Total Area Under Curve = %.3f kN\\cdotmm', AUC(end)))

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by