I understand that you want to read a file which is in ".GRD" format and then write it into ".CSV" format but you are encountering issues while opening the ".GRD" file.
You can open the ".GRD" file using "fopen" function of MATLAB and then read using "fread" function of MATLAB. Kindly refer to the following MATLAB Answer for more insights: https://www.mathworks.com/matlabcentral/answers/1464624-unable-to-read-the-grd-file-using-grdread2-m-function
Once you have read the data from the file then you can use the "writematrix" function of MATLAB to write data into ".CSV" format.
Here is a small code snippet which might be useful:
filename=['XYZ.grd'];
fileID = fopen(filename);
output = fread(fileID,'float');
writematrix(output,'new.csv');
Kindly refer to the documentation of the functions used above:
- "fopen": https://www.mathworks.com/help/releases/R2021a/matlab/ref/fopen.html
- "fread":https://www.mathworks.com/help/releases/R2021a/matlab/ref/fread.html
- "writematrix": https://www.mathworks.com/help/releases/R2021a/matlab/ref/writematrix.html
I hope this helps!
