0% found this document useful (0 votes)
75 views2 pages

Matlab Code:: 'Fontsize' On 'Stress Versus Strain' 'Stress (Mpa) ' 'Strain'

This Matlab code calculates stress and strain values for a material sample based on input values for load (L) and cross-sectional area (N). It generates two plots of stress versus strain, one with the full range of strain values and one zoomed in to strains between 0 and 0.009.

Uploaded by

Midi Riyanto
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views2 pages

Matlab Code:: 'Fontsize' On 'Stress Versus Strain' 'Stress (Mpa) ' 'Strain'

This Matlab code calculates stress and strain values for a material sample based on input values for load (L) and cross-sectional area (N). It generates two plots of stress versus strain, one with the full range of strain values and one zoomed in to strains between 0 and 0.009.

Uploaded by

Midi Riyanto
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Matlab Code:

N = [0 7330 15100 23100 30400 34400 38400 41300 44800 46200 47300 47500 46100
44800 42600 36400];
L = [50.8 50.851 50.902 50.952 51.003 51.054 51.308 51.816 52.832 53.848
54.864 55.88 56.896 57.658 58.42 59.182];
r = 12.8*10^(-3)/2;
lo = 50.8;
for i = 1:length(N)
G(i) = N(i)/(pi()*r^(2))/(10^6)
k(i) = (L(i)-lo)/lo
end
figure()
set(gca,'fontsize',16)
hold on
plot(k,G)
title('Stress versus Strain')
ylabel('Stress (MPa)')
xlabel('Strain')
figure()
set(gca,'fontsize',16)
hold on
plot(k,G)
title('Stress versus Strain')
ylabel('Stress (MPa)')
xlabel('Strain')
xlim([0,0.009])

Output:
G=
Columns 1 through 12
0 56.9632 117.3457 179.5156 236.2456 267.3306 298.4155 320.9521 348.1514 359.0312
367.5795 369.1338
Columns 13 through 16
358.2540 348.1514 331.0547 282.8730
k=
Columns 1 through 12
0 0.0010 0.0020 0.0030 0.0040 0.0050 0.0100 0.0200 0.0400 0.0600 0.0800
0.1000
Columns 13 through 16
0.1200 0.1350 0.1500 0.1650

You might also like