Average data of 5 samples with different array length (tensile test dogbone)
8 views (last 30 days)
Show older comments
JONATHAN AMBROSE
on 11 Dec 2021
Answered: Star Strider
on 11 Dec 2021
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?
0 Comments
Accepted Answer
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)])
y2i = interp1(x2, y2, x1);
meanStrain = mean([y1; y2i],1)
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.
.
0 Comments
More Answers (0)
See Also
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!