I have two .dat files. They are world.dat
and sensor_data.dat
. I have a folder name in D: drive named tutorial
. Within this tutorial file, there are two folders data
and code
. Now in the data folder, there are two files as I mentioned earlier world.dat
and sensor_data.dat
. In the code folder, there is a file name main.m as it is a Matlab file.
The code that is written on this file(main.m) is
clc;
clear;
close all;
% Read *.dat files containing landmark data
landmarks = fopen('../data/world.dat');
landmarks_data = fread(landmarks);
% Read *.dat files containing odometry and range-bearing sensor data
data = fopen('../data/sensor_data.dat');
data_data = fread(data);
But when I print landmarks_data and data_data they print something other than that is written on those two files(world.dat,sensor_data.dat)
world.dat file contains:
1 2 1
2 0 4
3 2 7
4 9 2
5 10 5
6 9 8
7 5 5
8 5 3
9 5 9
My output:
>> landmarks_data
landmarks_data =
49
32
50
32
49
10
50
32
48
32
52
10
51
32
50
32
55
10
52
32
57
32
50
10
53
32
49
48
32
53
10
54
32
57
32
56
10
55
32
53
32
53
10
56
32
53
32
51
10
57
32
53
32
I don't know where they get those data? The same thing happened for data_data variable.
Need help to fix the problem.