Hi Agung,
The reason these examples have that line
omap = mapData.omap;
has to do with the behavior of the load command, which packs all saved variables into a struct, with each field in the struct corresponding to a variable that was saved to the MAT-file. In the examples you've seen, we happened to save an occupancyMap variable whose variable name was omap, for you that name might be different.
The easiest way to figure out what's stored in your struct is to run the load command without the semi-colon, e.g:
Guessing from your map-generation script, the map in your randomap.mat file is most likely named map3D, so you'll likely want the following:
% Load data into struct
mapData = load("randomap.mat");
% Extract map into your local variable
myMapVariable = mapData.map3D;
Hope this helps,
Cameron