⑴ 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