Hi Muhammad, welcome to Julia community. You write:
But note that such usage does not follow the instructions given on the MAT.jl page:
To read a single variable from a MAT file (compressed files are detected and handled automatically):
file = matopen("matfile.mat")
read(file, "varname") # note that this does NOT introduce a variable ``varname`` into scope
close(file)