Average data of 5 samples with different array length (tensile test dogbone)

8 views (last 30 days)
Hello Matlab Community!
I have tensile test of 5 dogbone samples. Each have a different strain value, hence, different array length.
How do I go about to get the average of the 5 samples with the different array length?

Accepted Answer

Star Strider
Star Strider on 11 Dec 2021
They don’t all share the same ‘strain’ values, so it is only possible to compare them over the ‘strain’ values they share.
Choose the shortest vector, then use those ‘strain’ values to interpolate the others to it. Then, do the comparison.
A trivial example —
x1 = sort([0 rand(1, 10)*8]);
y1 = rand + x1.^2;
x2 = sort([0 rand(1, 12)*10]);
y2 = 0.5+rand + x2.^2;
[minlen,ix] = min([size(x1,2), size(x2,2)])
minlen = 11
ix = 1
y2i = interp1(x2, y2, x1);
meanStrain = mean([y1; y2i],1)
meanStrain = 1×11
1.1883 1.2349 2.8758 9.0506 11.6323 15.3724 17.3367 22.2976 29.8460 33.4239 33.9377
figure
subplot(2,1,1)
plot(x1, y1)
hold on
plot(x2,y2)
hold off
grid
title('Original')
xl = xlim;
yl = ylim;
subplot(2,1,2)
plot(x1, y1)
hold on
plot(x1, y2i)
plot(x1, meanStrain, ':r', 'LineWidth',1.5)
grid
title('Interpolated & Compared')
xlim(xl)
ylim(yl)
Experiment with the available data.
While it may be tempting to extrapolate the shorter vectors instead, however this creates data that were not originally obtained (and so do not actually exist), and so for all intents and purposes, worthless. Use oinly the available data and the analysis will be correct.
.

More Answers (0)

Categories

Find more on Stress and Strain in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!