Write a matlab program that reads the text file(as table given is the stress and
ID: 3677800 • Letter: W
Question
Write a matlab program that reads the text file(as table given is the stress and starin values, consider this as a text file that should have to be read out) and outputs (to the command window) the longitudinal Young’s modulus of the composite material. To find the young’s modulus, you may use the following regression model :
l= Where E is the young modulus (pa) s the stran is the strain (- is stress (pa) Use the fprintf command Use the fprintf command with %e format to display your output in the command window. Be sure to not the unitsExplanation / Answer
%loading the two columns into two arrays leaving the first line
[stress, strain] = textread(‘fname’,’headerlines’,1);
Sigma1 = 0;
Sigma2 = 0;
%calculating young's modulus
For i = 0:11
Sigma1 = sigma1 + (stress(i)*strain(i));
Sigma2 = sigma2 + (strain(i)*strain(i));
end
Modulus = sigma1/sigma2;
Fprintf(“value : %e ”,modulus);
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.