-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplotAll.m
More file actions
30 lines (22 loc) · 718 Bytes
/
plotAll.m
File metadata and controls
30 lines (22 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function [] = plotAll(Cells, fig)
%function plotCarsAll plottet die Autos über die Zeit
CellsNumber = (size(Cells,1)-1)/2;
position = (0:2*CellsNumber+1);
for t=1:size(Cells,2)
Cars = Cells(:, t, 2);
%X2 = Cells(CellsNumber+1:CellsNumber*2+1, t, 2);
Carsp = position(Cars ~= 0);
if(t == 1)
X = Carsp;
Y = ones(size(Carsp));
Z = Cells(Cells(:, t, 2) ~= 0, t, 2)';
else
X = [X, Carsp];
Y = [Y, t*ones(size(Carsp))];
Z = [Z, Cells(Cells(:, t, 2) ~= 0, t, 2)'];
end
end
%Plot
scatter(fig, X, Y,[], Z, 'filled');
ylabel(fig, 'Zeit')
end