You are on page 1of 4

Sol

M File

disp('This software calculates the stress in mega pascal');

f=input('Enter the value of force in newtons=');

a=input('Enter the value of area in millimetersquare=');

stress=f/a;

fprintf('The value of stress in mega pascal is %3.1f\n',stress);

Output

This software calculates the stress in mega pascal

Enter the value of force in newtons=20000

Enter the value of area in millimetersquare=80

The value of stress in mega pascal is 250.0


Sol

M File

disp('This software calculates the diameter of the cable');

f=input('Enter the force in the newtons =');

s=input('Enter the value of stress in mega pascal=');

area=f/s;

d=sqrt((4*area)/pi);

fprintf('The diameter of the cable in millimeters is %3.1f\n',d);

Output

This software calculates the diameter of the cable

Enter the force in the newtons =1000

Enter the value of stress in mega pascal=7.8

The diameter of the cable in millimeters is 12.8

Sol

M File

disp('This software calculates the compressive stress');


f=input('Enter the compressive force in newtons=');

a=input('Enter the area of square section in millimetersquare=');

stress=f/a;

fprintf('The compressive stress in megapascal is %3.2f\n',stress);

Output

This software calculates the compressive stress

Enter the compressive force in newtons=10000

Enter the area of square section in millimetersquare=144

The compressive stress in megapascal is 69.44

You might also like