I have a file from MATLAB in (.mat) format. I want to import this in GRASS GIS, but I get the following warning.
2 Answers
The .m file is not readable by GRASS: you need to save your data in a .mat file
in matlab (note that I force the use of version 4):
save('yourfile.mat','-v4')
-
Thanks, my friend. You are right, of course I also meant the .mat format, but I mistyped the .m (as shown in the image above.) What do you mean by (-v4)? Explain a little.Thanks for your guidance– saeedCommented Dec 3, 2020 at 17:32
-
by default the mat file will be exported in the latest Matlab version, but the grass tool needs version 4 (an older version)– radouxjuCommented Dec 4, 2020 at 8:58
You can use the SciPy scipy.io
to read and write .mat files using the functions loadmat
and savemat
in Python. https://docs.scipy.org/doc/scipy/reference/io.html