brownian.m
来自「matlab 数值计算 数据和源文件」· M 代码 · 共 18 行
M
18 行
% BROWNIAN Two-dimensional random walk.
% What is the expansion rate of the cloud of particles?
shg
clf
set(gcf,'doublebuffer','on')
delta = .002;
x = zeros(100,2);
h = plot(x(:,1),x(:,2),'.');
axis([-1 1 -1 1])
axis square
stop = uicontrol('style','toggle','string','stop');
while get(stop,'value') == 0
x = x + delta*randn(size(x));
set(h,'xdata',x(:,1),'ydata',x(:,2))
drawnow
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?