下附相应的程序代码,供各位参考,希望大家指点一二,谢谢!
%光栅衍射函数
clear all;
clc;
d = 4.5;
b = 1.5;
N = 5;
lamga = 0.8;
m = 1;
for i=-0.5:0.001:0.5
seta = i*pi;
temp_1 = (sinc(b*sin(seta)/lamga))^2;
temp_2 = (N*sinc(N*d*sin(seta)/lamga)/sinc(d*sin(seta)/lamga))^2;
I(m) = temp_1*temp_2;
m = m+1;
end
x = -0.5:0.001:0.5;
figure
plot(x*pi,I);
x=-5:5;
set(gca,'XTick',0);
set(gca,'XTickLabel',num2str(x,0.03));
%set(gca,'XTickLabel',{'-3','-2','-1','0','1','2','3'}); 这一行用于替换紧接着的上面三行以实现 lb107兄的建议
axis tight
title('光栅衍射分布图');
xlabel('单位为弧度')
[ 本帖最后由 duguyun 于 2006-10-10 22:34 编辑 ] |