How to create grating diffraction pattern.
42 ビュー (過去 30 日間)
古いコメントを表示
How to create a code to plot the intensity of the light I see from the grating diffraction in theory.
The graph shows only the diffraction ranking at zero. I want the graph to show the first number diffraction.
Who can see if it might go wrong? Please help me.
x = linspace(-50, 50, 500);
A = 4*W;
lambda = 632.8e-9; % m
D = 1; % Distance to the observation plane m
W = 38e-6; % slit width(m)
fx = x/(lambda*D); % frequency coordinat
I = (A^2/(lambda^2*D^2)) .* sinc(2*W*fx).^2;
figure
plot(x, I)
grid
xlabel('fx')
ylabel('Intensity')
1 件のコメント
Star Strider
2020 年 3 月 2 日
@Rose Mermate —
You quoted the code I posted in your other Question: How to create a code to plot the intensity of the light
That should do everything you want.
What part of my Answer do you need help to understand?
採用された回答
KALYAN ACHARJYA
2020 年 3 月 2 日
編集済み: KALYAN ACHARJYA
2024 年 12 月 30 日
x = linspace(-50, 50, 500);
lambda = 632.8e-9; % m
D = 1; % Distance to the observation plane m
W = 38e-6;
A = 4*W;% slit width(m)
fx = x/(lambda*D); % frequency coordinat
I = (A^2/(lambda^2*D^2)) .* sinc(2*W*fx).^2;
figure, plot(x,I)
grid
xlabel('fx')
ylabel('Intensity');
% Just repeat the same row multiple times
% For Better visualisation
grad_pattern=repelem(I,[50],[1]);
figure,imshow(grad_pattern,[]);
title('Diffraction Pattern');
8 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Data Distribution Plots についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!