line()函數可以在畫布中畫一些輔助線。
line([x的范圍],[y的范圍])
line([1,2],[3,4])將畫出(1,3)到(2,4)的一條直線,而不是(1,2)到(3,4)。
舉例:
figure(100);hold on;plot(1:10000,ds(1:10000),'r.');
figure(100);hold on;plot(1:10000,ds(1:10000));
figure(100);hold on;plot([0,10000],[0.5,0.5],'color','r');
figure(100);hold on;plot([0,10000],[0.5,0.5],'color','r','LineWidth',10);
注意:橫坐標上有100萬個數據點,需要畫一條直線y=0.5.

