-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstructSpace.m
More file actions
42 lines (31 loc) · 967 Bytes
/
constructSpace.m
File metadata and controls
42 lines (31 loc) · 967 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
robotPositionAnt = [-inf -inf -inf];
lineCounter = 0;
readingFile = fopen('space.txt','r');
while(1)
line = fgetl(readingFile);
if (~ischar(line))
break;
else
lineCounter = lineCounter + 1;
end
end
totalLines = lineCounter;
lineCounter = 0;
readingFile = fopen('space.txt','r');
positionsX = zeros(1,totalLines);
positionsY = zeros(1,totalLines);
while(1)
line = fgetl(readingFile);
if (~ischar(line))
break;
else
porcent = lineCounter / totalLines*100
lineCounter = lineCounter + 1;
tagId = char(sscanf(line,'%*f %*f %*f %s %*d %*d %*d %*d %*d %*d %*d %*d')');
values =sscanf(line,'%f %f %f %*s %d %d %d %d %d %d %d %d');
robotPosition = [values(1) values(2) values(3)];
positionsX(lineCounter) = values(1);
positionsY(lineCounter) = values(2);
end
end
plot(positionsX,positionsY,'x',positionsX,positionsY)