matlab數字圖像處理基本操作 MATLAB數字圖像處理算法程序



文章插圖
matlab數字圖像處理基本操作 MATLAB數字圖像處理算法程序

文章插圖
1. 實驗與觀察:函數的可視化1.1 Matlab二維繪圖命令
1. 周期函數與線性-周期函數
觀察:
clf, x=linspace(0,8*pi,100);F=inline('sin(x+cos(x+sin(x)))');y1=sin(x+cos(x+sin(x)));y2=0.2*x+sin(x+cos(x+sin(x)));plot(x,y1,'k:',x,y2,'k-')legend('sin(x+cos(x+sin(x))','0.2x+sin(x+cos(x+sin(x)))',2)2. plot指令:繪制直角坐標的二維曲線
3. 圖形的屬性設置和屏幕控制
h=plot([0:0.1:2*pi],sin([0:0.1:2*pi])); grid onset(h,'LineWidth',5,'color','red'); set(gca,'GridLineStyle','-','fontsize',16)設置y坐標的刻度并加以說明 , 并改變字體的大小 。
h=plot([0:0.1:2*pi],sin([0:0.1:2*pi]));grid on , set(gca,'ytick',[-1 -0.5 0 0.5 1]),set(gca,'yticklabel','a|b|c|d|e'),set(gca,'fontsize',20)4. 文字標注指令
plot(x,y1,'b',x,y2,'k-') ,set(gca,'fontsize',15,'fontname','times New Roman'),%設置軸對象的字體為times New Roman , 字體的大小為15title(' it{Peroid and linear peroid function}');%加標題 , 注意文字用單引號' '加上斜杠''后可輸入不同的設置 , 例如it{…}表示花括號里的文字為斜體;如果有多項設置 , 則可用………連續輸入 。xlabel('x from 0 to 8*pi it{t}'); ylabel('it{y}');%說明坐標軸text(x(49),y1(50)-0.4,'fontsize{15}bulletleftarrowThe period function {itf(x)}');%在坐標(x(49),y1(50)-0.4)處作文字說明 ,  各項設置用""隔開 。%fontsize{15}bulletleftarrow的意義依次是:字體大小=15畫圓點 左箭頭text(x(14),y2(50)+1,'fontsize{15}The linear periodfunction {itg(x)}rightarrowbullet')%與上一語句類似 , 用右箭頭