?? paint1.m
字號:
function paint1()
h1=figure('MenuBar','none',...
'ToolBar','none',...
'Position',[550 350 400 300],...
'Name','剪力圖');
h2=axes('Parent',h1,...
'Position',[0.15 0.15 0.78 0.8],...
'Visible','off');
l1=str2num(get(hedit16,'String'));
l2=str2num(get(hedit17,'String'));
l3=str2num(get(hedit18,'String'));
l4=str2num(get(hedit19,'String'));
l5=str2num(get(hedit20,'String'));
l=l1+l2+l3+l4+l5;
x=0:0.01:l;
y=x*0;
n1=str2num(get(hedit46,'String'));
n2=str2num(get(hedit47,'String'));
n3=str2num(get(hedit48,'String'));
n4=str2num(get(hedit49,'String'));
n5=str2num(get(hedit50,'String'));
n6=str2num(get(hedit51,'String'));
n7=str2num(get(hedit52,'String'));
n8=str2num(get(hedit53,'String'));
n9=str2num(get(hedit54,'String'));
n10=str2num(get(hedit55,'String'));
m1=str2num(get(hedit26,'String'));
if get(hcheckbox11,'Value')==1
v1=(-n1+n2)/2+m1/2;
v11=(-n1+n2)/2-m1/2;
else v1=(-n1+n2)/2;
v11=(-n1+n2)/2;
end
x1=[0 l1/2];
y1=[-n1 v1];
t1=polyfit(x1,y1,1);
s1=0:0.01:l1/2;
z1=polyval(t1,s1);
x11=[l1/2 l1];
y11=[v11 n2];
t11=polyfit(x11,y11,1);
s11=l1/2:0.01:l1;
z11=polyval(t11,s11);
m3=str2num(get(hedit28,'String'));
if get(hcheckbox21,'Value')==1
v2=(-n3+n4)/2+m3/2;
v21=(-n3+n4)/2-m3/2;
else v2=(-n3+n4)/2;
v21=(-n3+n4)/2;
end
x2=[l1 l1+l2/2];
y2=[-n3 v2];
t2=polyfit(x2,y2,1);
s2=l1:0.01:l1+l2/2;
z2=polyval(t2,s2);
x21=[l1+l2/2 l1+l2];
y21=[v21 n4];
t21=polyfit(x21,y21,1);
s21=l1+l2/2:0.01:l1+l2;
z21=polyval(t21,s21);
m5=str2num(get(hedit30,'String'));
if get(hcheckbox31,'Value')==1
v3=(-n5+n6)/2+m5/2;
v31=(-n5+n6)/2-m5/2;
else v3=(-n5+n6)/2;
v31=(-n5+n6)/2;
end
x3=[l1+l2 l1+l2+l3/2];
y3=[-n5 v3];
t3=polyfit(x3,y3,1);
s3=l1+l2:0.01:l1+l2+l3/2;
z3=polyval(t3,s3);
x31=[l1+l2+l3/2 l1+l2+l3];
y31=[v31 n6];
t31=polyfit(x31,y31,1);
s31=l1+l2+l3/2:0.01:l1+l2+l3;
z31=polyval(t31,s31);
m7=str2num(get(hedit32,'String'));
if get(hcheckbox41,'Value')==1
v4=(-n7+n8)/2+m7/2;
v41=(-n7+n8)/2-m7/2;
else v4=(-n7+n8)/2;
v41=(-n7+n8)/2;
end
x4=[l1+l2+l3 l1+l2+l3+l4/2];
y4=[-n7 v4];
t4=polyfit(x4,y4,1);
s4=l1+l2+l3:0.01:l1+l2+l3+l4/2;
z4=polyval(t4,s4);
x41=[l1+l2+l3+l4/2 l1+l2+l3+l4];
y41=[v41 n8];
t41=polyfit(x41,y41,1);
s41=l1+l2+l3+l4/2:0.01:l1+l2+l3+l4;
z41=polyval(t41,s41);
m9=str2num(get(hedit34,'String'));
if get(hcheckbox51,'Value')==1
v5=(-n9+n10)/2+m9/2;
v51=(-n9+n10)/2-m9/2;
else v5=(-n9+n10)/2;
v51=(-n9+n10)/2;
end
x5=[l1+l2+l3+l4 l1+l2+l3+l4+l5/2];
y5=[-n9 v5];
t5=polyfit(x5,y5,1);
s5=l1+l2+l3+l4:0.01:l1+l2+l3+l4+l5/2;
z5=polyval(t5,s5);
x51=[l1+l2+l3+l4+l5/2 l1+l2+l3+l4+l5];
y51=[v51 n10];
t51=polyfit(x51,y51,1);
s51=l1+l2+l3+l4+l5/2:0.01:l1+l2+l3+l4+l5;
z51=polyval(t51,s51);
if -n1>0
f1=0:0.01:-n1;
else f1=-n1:0.01:0;
end
if n2>-n3
f2=-n3:0.01:n2;
else f2=n2:0.01:-n3;
end
if n4>-n5
f3=-n5:0.01:n4;
else f3=n4:0.01:-n5;
end
if n6>-n7
f4=-n7:0.01:n6;
else f4=n6:0.01:-n7;
end
if n8>-n9
f5=-n9:0.01:n8;
else f5=n8:0.01:-n9;
end
if n10>0
f6=0:0.01:n10;
else f6=n10:0.01:0;
end
if v1>v11
f7=v11:0.01:v1;
else f7=v1:0.01:v11;
end
if v2>v21
f8=v21:0.01:v2;
else f8=v2:0.01:v21;
end
if v3>v31
f9=v31:0.01:v3;
else f9=v3:0.01:v31;
end
if v4>v41
f10=v41:0.01:v4;
else f10=v4:0.01:v41;
end
if v5>v51
f11=v51:0.01:v5;
else f11=v5:0.01:v51;
end
i0=0;
i1=l1/2;
i2=l1;
i3=l1+l2/2;
i4=l1+l2;
i5=l1+l2+l3/2;
i6=l1+l2+l3;
i7=l1+l2+l3+l4/2;
i8=l1+l2+l3+l4;
i9=l1+l2+l3+l4+l5/2;
i10=l1+l2+l3+l4+l5;
plot(x,y,'r',s1,z1,'b',s11,z11,'b',s2,z2,'b',s21,z21,'b',s3,z3,'b',s31,z31,'b',s4,z4,'b',s41,z41,'b',s5,z5,'b',s51,z51,'b');
grid;
hold on
plot(i0,f1,'b',i2,f2,'b',i4,f3,'b',i6,f4,'b',i8,f5,'b',i10,f6,'b',i1,f7,'b',i3,f8,'b',i5,f9,'b',i7,f10,'b',i9,f11,'b');
hold off
xlabel('桿長');
ylabel('剪力');
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -