File:Random walk in2D closeup.png
From Wikimedia Commons, the free media repository
Jump to navigation
Jump to search
Size of this preview: 510 × 599 pixels. Other resolutions: 204 × 240 pixels | 409 × 480 pixels | 842 × 989 pixels.
Original file (842 × 989 pixels, file size: 29 KB, MIME type: image/png)
File information
Structured data
Captions
File:random walk 2500.svg is a vector version of this file. It should be used in place of this PNG file when not inferior.
File:Random walk in2D closeup.png → File:random walk 2500.svg
For more information, see Help:SVG.
|
Made by myself with MATLAB.
This diagram was created with MATLAB.
Public domainPublic domainfalsefalse |
I, the copyright holder of this work, release this work into the public domain. This applies worldwide. In some countries this may not be legally possible; if so: I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law. |
Note. One may need to modify the step size, the number of steps, and rerun the code to get a picture similar to the above.
function main()
lw = 1; % line width
dx=0.05; % step size
L=1; % window size
N = 5000; % number of steps
ii=sqrt(-1);
AP =(1+ii)*ones(1, N);
% do the random walk with N steps. Save the results in AP
P=0;
for i=1:N
AP(i)=P;
dP = (1+ii)*dx*(hrand+ii*hrand)/2;
P = P+dP;
end
figure(2); clf; hold on; axis equal; axis off;
plot(real(AP), imag(AP), 'color', 'r', 'linewidth', lw);
saveas(gcf, 'random_walk_in2D_closeup.eps', 'psc2')
% chose randomly a number from the set {-1, 1}
function z=hrand
z=0;
while z==0
z=rand(1)-0.5;
z = sign(z);
end
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 03:39, 18 April 2007 | 842 × 989 (29 KB) | Oleg Alexandrov (talk | contribs) | Made by myself with MATLAB. {{PD-self}} ==Source code== '''Note.''' One may need to modify the step size, the number of steps, and rerun the code to get a picture similar to the above. <pre> <nowiki> function main() lw = 1; % line width dx=0.0 |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
File usage on other wikis
The following other wikis use this file:
- Usage on ar.wikipedia.org
- Usage on en.wikipedia.org
- Usage on eo.wikipedia.org
- Usage on es.wikipedia.org
- Usage on fr.wikipedia.org
- Usage on gl.wikipedia.org
- Usage on ko.wikipedia.org
- Usage on pt.wikipedia.org
- Usage on simple.wikipedia.org