Professional Documents
Culture Documents
close all;
clear all;
fid=fopen('beam.txt','w');
fprintf(fid,'program 1. Moment of resistance of beam \n');
fprintf(fid,'
---------------------------- \n');
fck=input('\nEnter the grade of concrete fck(N/mm^2)
');
fy=input('\nEnter the grade of steel fy(N/mm^2)
');
fprintf(fid,'\nGrade of concrete fck(N/mm^2)%10.2f\n',fck);
fprintf(fid,'\nGrade of steel fy(N/mm^2))%10.2f\n',fy);
fyd=fy/1.15;
Es=2*10^5;
k=menu('Select type of beam','T beam','L beam',' Rectangular beam');
if k==1
fprintf(fid,'T beam \n');
bw=input('\nEnter the width of web bw(mm)
');
Df=input('\nEnter the depth of flange Df(mm)
');
D=input('\nEnter the depth of section D(mm)
');
L=input('\nEnter the effective span of beam L(m)
');
k=1;
fprintf(fid,'\n Width of web bw(mm))%10.2f\n',bw);
fprintf(fid,'\n Depth of flange Df(mm) %10.2f\n',Df);
fprintf(fid,'\n Depth of section D(mm) %10.2f\n',D);
fprintf(fid,'\n Effective span of beam L(m) %10.2f\n',L);
elseif k==2
fprintf(fid,'L beam \n');
bw=input('\nEnter the width of web bw(mm)
');
Df=input('\nEnter the depth of flange Df(mm)
');
D=input('\nEnter the depth of section D(mm)
');
L=input('\nEnter the effective span of beam L(m)
');
k=.5;
fprintf(fid,'\n Width of web bw(mm))%10.2f\n',bw);
fprintf(fid,'\n Depth of flange Df(mm) %10.2f\n',Df);
fprintf(fid,'\n Depth of section D(mm) %10.2f\n',D);
fprintf(fid,'\n Effective span of beam L(m) %10.2f\n',L);
else
fprintf(fid,'Rectangular section \n');
b=input('\nEnter the width of beam b(mm)
');
D=input('\nEnter the depth of beam D(mm)
');
L=input('\nEnter the effective span of beam L(m)
');
k=0;
bw=b;
Df=D;
fprintf(fid,'\n Width of beam b(mm))%10.2f\n',b);
fprintf(fid,'\n Depth of beam D(mm) %10.2f\n',D);
fprintf(fid,'\n Effective span of beam L(m) %10.2f\n',L);
end
s=menu('Select type of section','singly reinforced section','Doubly reinforced
section');
if s==1
fprintf(fid,'singly reinforced section \n');
nt=input('\nEnter the number of bars in tension
');
dt=input('\nEnter the diameter of bars in tension dt(mm)
');
fprintf(fid,'\n Number of bars in tension %10.2f\n',nt);
fprintf(fid,'\n Diameter of bars in tension dt(mm) %10.2f\n',dt);
Asc=0;
Dl=0;
else
end
fclose(fid);