File:Dirac function approximation.gif
来自testwiki
跳转到导航
跳转到搜索
Dirac_function_approximation.gif (200 × 335像素,文件大小:89 KB,MIME类型:image/gif、循环、10帧、2.0秒)
本文件来自维基共享资源并可能被其他项目使用。 其文件描述页上的描述显示在下面。
| 描述Dirac function approximation.gif | Illustration of approximating the Dirac delta function by gaussians. |
| 日期 | (UTC) |
| 来源 | self-made with MATLAB |
| 作者 | Oleg Alexandrov |
| Public domainPublic domainfalsefalse |
| 我,本作品著作权人,释出本作品至公有领域。这适用于全世界。 在一些国家这可能不合法;如果是这样的话,那么: 我无条件地授予任何人以任何目的使用本作品的权利,除非这些条件是法律规定所必需的。 |
Source code (MATLAB)
% Illustration of approximating the Dirac delta function with gaussians.
function main()
r = 3; % the power in the Bernoulli inequality
% KSmrq's colors
red = [0.867 0.06 0.14];
blue = [0, 129, 205]/256;
green = [0, 200, 70]/256;
yellow = [254, 194, 0]/256;
white = 0.99*[1, 1, 1];
% Set up the grid and other parameters
N = 300;
A = -2; B = 2;
C=-1; D = 6;
X = linspace(A, B, N);
% Set up the figure
lw = 3; % linewidth
fs = 18; % font size
for p=1:10
a=1/p;
% gaussian
Y=(1/(a*sqrt(pi)))*exp(-X.^2/a^2);
figure(1); clf;
set(gca, 'fontsize', fs);
set(gca, 'linewidth', 0.4*lw)
hold on;
plot_axes (A, B, C, D, lw/1.5);
plot(X, Y, 'color', blue, 'linewidth', lw);
axis equal; axis([A, B, C, D]);
set(gca, 'XTick', [-2, -1, 0, 1, 2]) % text labels on the x axis
grid on;
H=text(B-1.5, D-0.5, sprintf('a=1/%d', p), 'fontsize', fs);
% save to disk
file = sprintf('Frame%d.eps', 1000+p);
disp(file);
saveas(gcf, file, 'psc2')
pause(0.1);
end
% Converted to gif with the command
% convert -antialias -density 100 -delay 20 -loop 10000 Frame10* Dirac_function_approximation.gif
% then scaled in Gimp
function plot_axes (A, B, C, D, lw)
gray = 0.5*[1, 1, 1];
plot([A B], [0, 0], 'linewidth', lw, 'color', gray);
plot([0, 0], [C, D], 'linewidth', lw, 'color', gray);
说明
添加一行文字以描述该文件所表现的内容
此文件中描述的项目
描繪內容
某些值没有维基数据项目
著作权持有者释出至公有领域 简体中文(已转写)
12 1 2008
image/gif
91,398 字节
335 像素
200 像素
文件历史
点击某个日期/时间查看对应时刻的文件。
| 日期/时间 | 缩略图 | 大小 | 用户 | 备注 | |
|---|---|---|---|---|---|
| 当前 | 2008年1月12日 (六) 23:51 | 200 × 335(89 KB) | wikimediacommons>Oleg Alexandrov | tweak |
文件用途
以下页面使用本文件:
