interpolation of 3d data

2 次查看(过去 30 天)
ashwani kumar
ashwani kumar 2019-4-18
I want to interpolate my data with respect to z values means the blank spaces present got filled and z values are interpolated by krigging technique and get result in x y z format but the codes present on the forum interpolates data in the form of bigger matrix and and also do not provide satisfactory results. some code also fails and returns error as data size is too large.
Can anybody pls suggest a code for this. Pls help.....

回答(1 个)

KSSV
KSSV 2019-4-18
编辑:KSSV 2019-4-18
data = importdata('slice1_grid1.txt') ;
x = data(:,1) ;
y = data(:,2) ;
z = data(:,3) ;
%% Make grid
m = 5000 ; n = 5000 ;
xi = linspace(min(x),max(x),m) ;
yi = linspace(min(y),max(y),n) ;
[X,Y] = meshgrid(xi,yi) ;
Z = griddata(x,y,z,X,Y) ;
pcolor(X,Y,Z)
shading interp
untitled.bmp
  2 个评论
ashwani kumar
ashwani kumar 2019-4-21
i want to store the interpolated data in x y z format in a text file but from here no values are assigned to z parameter. pls suggest something for that.
Walter Roberson
Walter Roberson 2019-4-21
output = [X(:), Y(:), Z(:)];
csvwrite('interpolated_slice.csv', output);

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 MathWorks Cloud Center 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by