⑴ matlab緙栫▼錛氬浘瑙f硶璁$畻鍚告敹濉旂悊璁哄旀澘鏁
clear
xa=0; %a鐐規í鍧愭爣
ya=0.0101; %a鐐圭旱鍧愭爣
xb=0.00524; %b鐐規í鍧愭爣
yb=0.25; %b鐐圭旱鍧愭爣
x=xa; %璧風偣妯鍧愭爣鍒濆
y=ya; %璧風偣綰靛潗鏍囧垵鍊
k=0; %濉旀澘鏁板垵鍊
while y<=yb
x1=y/20.7; %姘村鉤綰誇笌騫寵綰誇氦鐐規í鍧愭爣
y1=(yb-ya)/(xb-xa)*(x1-x)+y; %鍨傜洿綰誇笌鎿嶄綔綰誇氦鐐圭旱鍧愭爣
plot([x,x1],[y,y]) %緇樺埗姘村鉤綰挎
hold on
plot([x1,x1],[y,y1]) %緇樺埗鍨傜洿綰挎
k=k+1;
x=x1;
y=y1;
end
plot([xa,x],[ya,y],'--') %緇樺埗鎿嶄綔綰
plot([xa,xb],[ya,yb],'*') %緇樺埗a,b涓ょ偣
text(xa,ya+0.015,'a'); %鏍囨敞a鐐
text(xb,yb+0.015,'b'); %鏍囨敞b鐐
plot([0,x],[0,20.7*x],'-') %緇樺埗騫寵綰
k %杈撳嚭濉旀澘鏁
k =
4
鍗崇悊璁哄旀澘鏁頒負4