move plotting stuff to own folder

This commit is contained in:
2015-11-06 16:50:44 +01:00
parent 86978d4d41
commit 53d3e87442
23 changed files with 214 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
num_runs = 10;
max_steps = 1000;
positions = zeros(max_steps, num_runs);
for run = 1:num_runs
for step = 2:max_steps
x = randn(1);
if x < 0
positions(step, run) = positions(step-1, run) + 1;
elseif x > 0
positions(step, run) = positions(step-1, run) - 1;
end
end
end
figure()
hold on
for run = 1:num_runs
plot(1:max_steps, positions(:, run))
end
xlabel('Number of steps')
ylabel('Position')
box off