(1) 作圖函數(shù)
①plot(x,y,’color_point_linestyle’)
1) 單用plot函數(shù)畫多重圖
2) 用hold on函數(shù)畫多重圖
3) 特殊函數(shù)作圖
4) 作散點(diǎn)圖
② fplot(fun,limits,tol,’color_point_linestyle’)
fplot的數(shù)據(jù)點(diǎn)是自適應(yīng)產(chǎn)生的呈枉。在函數(shù)平緩處數(shù)據(jù)點(diǎn)稀疏而姐,函數(shù)劇烈變化處函數(shù)點(diǎn)密集。fun為函數(shù)名涨共,limits是繪制圖形坐標(biāo)軸的取值范圍岖寞,有[xmin,xmax]和[xmin,xmax,ymin,ymax]兩種方式抡四。tol表示相對誤差,默認(rèn)為2e-3.
③ ezplot(f,[xmin,xmax])
簡易繪圖函數(shù)仗谆。無需數(shù)據(jù)準(zhǔn)備指巡,默認(rèn)[xmin,xmax]=[-2*pi,2*pi]
(2) 輔助函數(shù)與參數(shù)
① ????grid? ? ? ? ? ? ? ? ? ? ? %網(wǎng)格
????????axis(a,b,c,d)? ? ? ? ?%將圖形限制在[a,b]*[c,d]間
????????title(‘...’)? ? ? ? ? ? ????%標(biāo)題
????????xlabel(‘...’)????????????%x坐標(biāo)標(biāo)簽
????????ylabel(‘...’)? ? ? ? ? ? %y坐標(biāo)標(biāo)簽
② figure? ? ? ? ? ? ? ? ? %新建圖表
③ hold on????????????%在同一個(gè)圖表上繼續(xù)畫圖
④ polyfit(x,y,n) ????%多項(xiàng)式回歸擬合,n為多項(xiàng)式次數(shù)
⑤ subplot(m,n,k)????%創(chuàng)建一個(gè)m*n的圖版胸私,并且在第k個(gè)位置畫圖(從左至右 再從上至下計(jì)數(shù))
⑥? ?’color_point_linestyle’相關(guān)參數(shù)