光的雙縫幹涉強度和幹涉條紋_MatLab

來源:互聯網
上載者:User
%光的雙縫幹涉強度和幹涉條紋
clear,n=3;dphi=(-1:0.01:1)*n*2*pi;
i=4*cos(dphi/2).^2;
figure,subplot(2,1,1)
plot(dphi,i,'LineWidth',2),grid on,axis tight
set(gca,'XTick',(-n:n)*2*pi)
fs=16;title('光的雙縫幹涉強度和幹涉條紋','FontSize',fs)
xlabel('相差\Delta\it\phi','FontSize',fs)
ylabel('相對強度\itI/I\rm_0','FontSize',fs)
subplot(2,1,2),c=linspace(0,1,64)';
colormap([c,0*c,0*c]);
image(i*16)

axis off,title('光的雙縫幹涉強度和幹涉條紋','FontSize',fs)


imshow與image的用法分析

相同點:
imshow與image都會產生一個image對象。

區別如下:
1.imshow的兩種用法:
1)imshow(路徑與檔案名稱字串)
2)imshow(映像矩陣)
若當前figure存在座標軸,imshow會將產生的image對象(即映像對象)顯示在當前座標軸內;
若當前figure不存在座標軸,imshow會產生一個隱藏的座標軸,並將產生的image對象顯示於其中;
2.imshow(路徑與檔案名稱字串)等價於:M=imread(路徑與檔案名稱字串);imshow(M);
3.imshow不會擴充填充映像資料,即不會展開映像使其鋪滿座標軸,而是改變座標軸寬高比使其適應映像資料;
4.image的用法:
M=imread(路徑與檔案名稱字串);image(M);
5.image不會改變座標軸的大小尺寸,而是擴充填充映像矩陣,使其鋪滿座標軸地區。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.