How to convert a GRD file to XYZ or MAT file

9 ビュー (過去 30 日間)
chaos4u2
chaos4u2 2013 年 3 月 4 日
回答済み: Jacob Valdes 2021 年 6 月 15 日
Hello, does anybody know how to convert a GRD file (from surfer) to a XYZ or MAT file. I would prefered MAT file. I've been looking but I couldn't find anything.
Thanks a lot for your help!!

回答 (1 件)

Jacob Valdes
Jacob Valdes 2021 年 6 月 15 日
function XYZ=grdtoxyz(X,Y,Z)
% X=(X,2);
% Y=(Y,2);
ccont=1;
for i=1:size(X,1)
for ii=1:size(X,2)
XYZ(ccont,:)=[X(i,ii) Y(i,ii) Z(i,ii)];
ccont=ccont+1;
end
end
XYZ= XYZ(isfinite(XYZ(:, 3)), :);
end

カテゴリ

Help Center および File ExchangeText Files についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by