Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

MATLAB ///// Create a custom function to calculate strain during a tension or co

ID: 2074460 • Letter: M

Question

MATLAB ///// Create a custom function to calculate strain during a tension or compression test. The input arguments should be deformation, original length. The output argument should be strain. Strain, (%), is calculated as change in length divided by the original length. NOTE: Deformation is the same as (deformed length – original length) in the equation for strain. Test your function using the following values of deformation (mm) and original length, L0, (mm): Deformation = 25.164, L0 = 25 Deformation = 29.150, L0=25

Explanation / Answer

% Just copy it and save as calcstrain(function name)

%Creating Custom Function For Calculting strain
% For given deformed length and original length
function strain = calcstrain(dl,l);
dl1=(dl-l);
strain=(dl1/l)*100;
end

%This is the function what you require
% To solve example just type our function name with input arugments
% i.e.calcstrain(deformedlength,original length)

%1st example  
%calcstrain(25.164,25)
%2nd example
%calcstrain(29.150,25)