0

I have a file from MATLAB in (.mat) format. I want to import this in GRASS GIS, but I get the following warning.

enter image description here

1
  • 1
    m files contain matlab scripts no data. You can't open them in GRASS.
    – Zoltan
    Dec 3, 2020 at 7:45

2 Answers 2

0

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')
2
  • 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
    – saeed
    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)
    – radouxju
    Dec 4, 2020 at 8:58
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.