% Double click the following files to get all of the data as column vectors
% averageAll.csv
% stressStrain.csv

%%% INSTRON GRAPH
errorbar(ExtensionLonly, LoadLonly, StdDevLonly);
hold on;
errorbar(ExtensionRonly, LoadRonly, StdDevRonly);
errorbar(ExtensionLR, LoadLR, StdDevLR);
errorbar(ExtensionLLL, LoadLLL, StdDevLLL);
errorbar(ExtensionLRL, LoadLRL, StdDevLRL);
hold off;

title('Average Run of All Trials');
xlabel('Extension (mm)')
ylabel('Load (N)');

legend('L only', 'R only', 'LR', 'LLL', 'LRL');

%%% MAX LOAD
figure;

maxLoads = [max(LoadLonly), max(LoadRonly), max(LoadLR), max(LoadLLL), max(LoadLRL) ];
maxStdDev = [std(LoadLonly), std(LoadRonly), std(LoadLR), std(LoadLLL), std(LoadLRL) ];

bar(1:5, maxLoads);
xticklabels({'L', 'R', 'LR', 'LLL', 'LRL'})
title('Max Load')
hold on;
errorbar(1:5, maxLoads, maxStdDev, 'o', 'LineWidth', 2);
hold off;

%%% STRESS-STRAIN CURVE
plot(StrainLonly, StressLonly);
hold on;
plot(StrainRonly, StressRonly);
plot(StrainLR, StressLR);
plot(StrainLLL, StressLLL);
plot(StrainLRL, StressLRL);
hold off;

title('Stress-Strain Curve');
xlabel('Strain (%)')
ylabel('Stress (Pa)');

legend('L only', 'R only', 'LR', 'LLL', 'LRL');

%%% SECANT MODULUS
figure;

% Values gotten from Excel
secantModulus = [188672.6, 199350.6, 433312.7, 1088503.78, 1161057];
secantStdDev = [10388.76, 10364.7, 14189.5, 49920.223, 33738.41];

bar(1:5, secantModulus, 0.5, 'FaceColor', [0.8 0.8 0.8]);
xticklabels({'L', 'R', 'LR', 'LLL', 'LRL'})
xlabel('Composite Material Type')
ylabel('Modulus (Pa)');
title('Secant Modulus')
hold on;
errorbar(1:5, secantModulus, secantStdDev, 'kx', 'LineWidth', 2);
hold off;

set(gcf, 'color', [1 1 1])

a = findobj(gcf, 'Type', 'text');
set(a, 'Fontweight', 'bold');
set(a, 'Fontsize', 16);
set(a, 'FontName', 'Ariel');

a = findobj(gcf, 'Type', 'axes');
set(a, 'Fontweight', 'bold');
set(a, 'FontSize', 16);
set(a, 'FontName', 'Ariel');
