文档详情

MATLAB之基本绘图功能.PPT

发布:2017-08-01约小于1千字共9页下载文档
文本预览下载声明
Lab 2: MATLAB之基本繪圖功能 二維X-Y座標圖 plot、 plot(x)、plot(x,y)、plot(x,y,’ ‘) loglog、semilogx、semilogy, logspace x=[1:1:5]; y=[1,4,9,16,25]; plot(x,y,’r+’);grid loglog(x,y);grid polar(Θ,ρ) x=0:(pi/18):(2*pi); y=1+cos(x); polar(x,y); plot相關參數及繪圖視窗應用 whitebg~for MATLAB 4.x graphic window 4.2~Edit?Copy Options 5.0~File?Preferences?Copying Options 顏色、形式 y(黃)、m(洋紅)、c(青)、r(紅) g(綠)、b(藍)、w(白)、k(黑) .、o、x、+、* -(實線)、:(點線)、-.(長點線)、--(虛線) 標題說明 title(‘string’) title(‘This plot is a test!’); xlabel(‘string’)、ylabel(‘string’) xlabel(‘time(second)’); ylabel(‘height(meter)’); text(x0,y0,’string’)、gtext(‘string’) text(2,4,‘It is here’); gtext(‘use your mouse to put the text!’); grid 圖形顯示控制 axis axis([Xmin Xmax Ymin Ymax])、axis(‘normal‘)、axis(‘square’) 輪流設定為設定範圍或自動調整 hold hold、hold on、hold off shg、clg subplot(mnp) MATLAB程式撰寫入門 .M file 簡介及其他 變數名稱=起始值:遞增值:終止值 函式 M file function、macro %~註解 流程控制 for end while、if,elself,else break,pause,return 練習作業 仿照前一頁程式,寫一matlab程式,劃出函數 其中 從 0 度到 360 度 * *
显示全部
相似文档