Surfer Grid import/export

버전 1.1.0.0 (1.18 KB) 작성자: Alberto Avila Armella
Import and export GS ASCII (GRD files) from and to Golden Software Applications like Surfer and Grap
다운로드 수: 5.3K
업데이트 날짜: 2009/4/13

라이선스 없음

Surfer Grid, import/export.

Matlab <-> Golden Software Surfer and Grapher

The pack contains two simple routines: grd_write.m and grd_read.m. They communicate Matlab with Golden Software Surfer by the GRD file format (ASCII version).

grd_write(matrix,xmin,xmax,ymin,ymax,namefile)
Input:
matrix = matrix to export
xmin,xmax,ymin,ymax = grid limits
namefile = name of the file to be written (include ".grd" extension)
Output:
grd file in current directory

[matrix xmin xmax ymin ymax]=grd_read(name of file)
Input:
nomarch = name of the file to be read, including ".grd" extension
Output:
matrix = matrix of the read data
xmin xmax ymin ymax = grid limits

* NOTE: Previous version of grd_read worked only with files saved in Surfer (or Grapher), but now is SOLVED. It runs faster also.

Example of use:

Creation of a matrix in Matlab:

x=linspace(-4,4,100);
y=linspace(-5,5,100);
[X,Y]=meshgrid(x,y);
Z=cos(sqrt(X.^2+Y.^2));

Export to surfer:

grd_write(Z,min(x),max(x),min(y),max(y),'example.grd')

Open in surfer and save as:

Open example.grd in Surfer (as a grid: file-> open). Then save it, for example with the name example_saved_by_surfer.grd. Remember to chose “GS ASCII (*.grd)”.

Load the saved file in Matlab

[matrix xmin xmax ymin ymax]=grd_read('example_saved_by_surfer.grd');

---Coded by Alberto Avila Armella, updated and improved by Jose Maria Garcia-Valdecasas

인용 양식

Alberto Avila Armella (2024). Surfer Grid import/export (https://www.mathworks.com/matlabcentral/fileexchange/20880-surfer-grid-import-export), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2007a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Data Import and Export에 대해 자세히 알아보기
도움

줌: xyz2grd

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.1.0.0

Previous version of grd_read worked only with files saved in Surfer (or Grapher), but now is SOLVED (by Jose Maria Garcia-Valdecasas). It runs faster also.

1.0.0.0