Interpolation of rectangular grid/array with Natural Neighbor and NANs, Hashing, Discontinous Interpolation and Surfaces
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a set of data with x and y (two different sized vectors, 1xn and 1xm) and some z-values(essentially a sparse matrix of z-values for a given set of x and y coordinates). My intent was to fill in the rest of the z-values (that are NaNs) in the x and y grid using natural neighbor interpolation and I am using MATLAB R2010A. My way of doing this was:
XArrayInit=1250:50:6000;
YArrayInit=60:10:400;
[qx,qy]=meshgrid(XArrayInit,YArrayInit)
[X,Y]=meshgrid(XArrayInit,YArrayInit);
nanflags=isnan(X)|isnan(Y)|isnan(PossibleZData);
X(nanflags)=[];
Y(nanflags)=[];
PossibleZData(nanflags)=[];
functioninterp=TriScatteredInterp(X(:),Y(:),PossibleZData(:),'natural');
qz=functioninterp(qx,qy);
mesh(qx,qy,qz);
This works fine for natural neighbor interpolation (I think) and helps me create a valid surface plot but I have two questions.
One, is there an easy way in MATLAB to create hash/bucket system for similar values so that I could create several surface plots (since my data is concentrated in particular areas), each using some form of interpolation (assuming that these dimensions create a nice mesh grid)? Two, if there is a set of points/ some region that is not necessarily rectangular or even continuous that where we know we want to interpolate, what are our best options?
댓글 수: 0
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!