scatteredinterpolant. Surf produces a pretty smooth surface, whereas with trisurf streaks start appearing. scatteredinterpolant

 
 Surf produces a pretty smooth surface, whereas with trisurf streaks start appearingscatteredinterpolant  scipy

Av = x (3)*x (4); % mm2 the web area when load is parallel to web. The data generated by. From MatLab documentation: ZI = interp2(X,Y,Z,XI,YI) returns matrix ZI containing elements corresponding to the elements of XI and YI and determined by interpolation within the two-dimensional function specified by matrices X, Y, and Z. I would like to extrapolate a surface I have provided in Matlab. My data: I have a tooth as in the upload, which is the result of. I have measured electric field data in three dimensions of the following form: Theme. % Class 2 taken to be the upper limit as same procedure as Class 1. class scipy. To suppress specific warning messages, you must first find the warning identifier. Community Treasure Hunt. So I did, and found to be twice slower for a 512 by 512 matrix. 您可以计算一组查询点(例如二维 (xq,yq) )处的 F 值,以得出插入的值 vq = F (xq,yq) 。. [x,y,z] = ndgrid (-10:10); Sample a function, v (x,y,z), at the. Learn more about TeamsHelp with scatteredInterpolant: masking and meshgrid alternatives. This program computes a Delaunay triangulation of the data points, and then constructs an interpolant triangle by triangle. -9999. F_a results from importated data where the parameters "m" and "h" have following dimensions: 1x5 double. Use griddedInterpolant to perform interpolation with gridded data. I gave u one part of the code. Interpolation in MATLAB ® is divided into techniques for data. For example, I have the following non-gridded data points, known v = F(x. Syntax: VI = scatteredInterpn(X. Create a PDE model and include the geometry of the built-in function squareg. This program computes a Delaunay triangulation of the data points, and then constructs an interpolant triangle by triangle. 使用 scatteredInterpolant 对散点数据的二维或三维数据集执行插值。scatteredInterpolant 返回给定数据集的插值函数 F。可以计算一组查询点(例如二维 (xq,yq))处的 F 值,以得出插入的值 vq = F(xq,yq)。. I haven't tried the inpaint_nans function yet, but will do so and see how it compares. Vq = interp2 ( ___,method) specifies an alternative interpolation method: 'linear' , 'nearest', 'cubic' , 'makima', or 'spline'. Create a 10-by-10-by-10 grid of sample points. Clearly at this point you can add your own cleaning method, but if you are using this class chances. Thin-plate spline extrapolation uses the tpaps function, and PCHIP extrapolation uses the pchip function. %coords supportPts = [3 3; 3. and I calculate with some formulas y=4. My question is : can we speed up the scatteredinterpolant function by using it with parallel too. I want to find the coordinates in the first data set that are closest to. F = scatteredInterpolant (T. 3D extrapolation without ScatteredInterpolant. CubicSpline. Interpolant surface fits use the MATLAB function scatteredInterpolant for the linear and nearest neighbor methods, and the MATLAB function griddata for the cubic spline and biharmonic methods. Learn how to use scatteredInterpolant to perform interpolation on a 2-D or 3-D data set of scattered data. The values v must be a column vector of. griddedInterpolant returns the interpolant F for the given data set. a=3. 25; 3. 1. I have tryed a lot with all possible other functions (pattern, griddata,. You can do something like this: Zi = griddata(X(:),Y(:),Z(:),Xi,Yi); And you do the same thing with scatteredInterpolant - the (:) construct just unwraps an array into a 1-D column array. Hello. It is also significantly faster than this function and have support for extrapolation. For interp2, the full grid is a pair of matrices whose elements represent a grid of points over a rectangular region. 8sec, scatteredInterpolant: 10,1sec. scatteredInterpolant contains data and it behaves like an array—in MATLAB language, it is called a value object. I want to interpolate onto a regular grid. I have been looking for a C# (C or C++ equivalents are fine too) equivalent of Mathlabs TriScatteredInterp or scatteredInterpolant methods. Dear all. 000 417826. 974 5333045. The 'linear' extrapolation method is based on a least-squares approximation of the gradient at the boundary of the convex hull. scatteredInterpolant supports (x, y, v, then options, or (x, y, z, v, then options, so building an interpolation object over 2d or over 3d, that you then invoke with the appropriate number of input parameters to get results. What I have is a bunch of points (x,y,w), where x and y are coordinates and w is the value. The scatteredInterpolant class supports scattered data interpolation in 2-D and 3-D space. You don't have to actually have the function, F, just the points that correspond to the x and y data points given. griddata in this case, but you seem to want a callable interpolator,. Scattered data, with some nasty stuff to interpolate on the edges, but still what appears to be a single valued relationship. Show -1 older comments Hide -1 older comments. In a previous discussion Kelly provided a means to convert a scattered vector to gridded information, but it can potentially take up a lot of memory. Then use the property 'Constraints' to specify the edges along the boundary of the actual domain you want to plot. 000 417826. Create a vector of scattered sample points v. scatteredInterpolant returns the interpolant F for the given data set. Use griddedInterpolant to perform interpolation with gridded data. But I wasn't able to find an evaluation method for the "scatteredInterpolant" - object. Show 2 older comments Hide 2 older comments. You specify x and y as key / control points with the corresponding z and g output points. If they're truly scattered, scatteredInterpolant is probably the best route. 974 5333045. When I did that step, command window shows " Requested 61890x61890 (28. If you have points which are described by vectors, and you want to plot them you could always use a Delauny triangulation. Use scatteredInterpolant instead. when I make mesh grid of x. interp2 is a wrapper for griddedInterpolant. There will be some areas where you get garbage. The griddata function supports 2-D scattered data interpolation. Problem in using scatteredInterpolant . Use the sizes of the first two matrix dimensions to resample the image so that it is 120% the size. ). The results always pass through the original sampling of the function. Sub-package for objects used in interpolation. This makes it easy to swap interpolators. The scatteredInterpolant function gives me "Warning: Duplicate data points have been detected and removed - corresponding values have been averaged. . "Warning: Duplicate data points have been detected and removed - corresponding values have been averaged. random. Teams. scatteredInterpolant had to be used. In a previous discussion Kelly provided a means to convert a scattered vector to gridded. Find the treasures in MATLAB Central and discover how the community can help you! Start Hunting!ScatteredInterpolant just does what it is told, having no idea that when you try to interpolate some point in that volume, it is creating meaningless gibberish as a result. 6 3; 3. 352622 0. New in version 0. 2-D array of data point coordinates, or a precomputed Delaunay triangulation. I am making voxels(stl) from 2D image stacks using [scatteredInterpolant] function. Not to worry: griddata with 2d cubic interpolation uses a CloughTocher2DInterpolator. My variables are x, y, z coordinates (3D space) and the respective values for each combination of x,y,z. 使用 scatteredInterpolant 进行的散点数据插值使用数据的 Delaunay 三角剖分,因此对采样点 x、y、z 或 P 中的缩放问题非常敏感。出现这种情况时,您可以使用 normalize 重新缩放数据并改进结果。有关详细信息,请参阅对不同量级的数据进行归一化。 使用 griddedInterpolant 对一维、二维、三维或 N 维 网格数据 集进行插值。. [new_lons,new_lats] =. All of the input arguments "x", "y", and "v. It is a quick and simple fix, but I. This i have calculated using multivariate linear regression. We often interpolate from solutions rather than rerun every case. Selecting an Extrapolation MethodCode. worse than linear. 插值. Each text file consist on three columns, first is latitude, second is longitude and third is temperature. For example; in my data. Hey everybody, Matlab is becoming my arch enemy and I need some brave soldier to help me with my next battle, I have the following data: x= [23 312 6546] y= [3 43 342] So I can. It makes sense since it does not have enough points to interpolate properly/sensibly. The only difference in my code was just using:Answered: Cris LaPierre on 5 Aug 2021. Z); f. The points in each dimension are in the range, [-10, 10]. The surface is always convex (as the name suggests)Use scatteredInterpolant to perform interpolation on a 2-D or 3-D data set of scattered data . One matrix contains the x-coordinates, and the other matrix contains the y-coordinates. A scattered data set is defined by sample points X and corresponding values v. I had the same problem with surface DEM's. See "lip" below":Similar to scatteredInterpolant (I guess) it uses delaunay tesselation and the user may choose among 3 algorithms: bilinear interpolation, sibson (default) and "non-sibsonian" interpolation. Hello everyone. % Class 2 taken to be the upper limit as same procedure as Class 1. Theme. So I did, and found to be twice slower for a 512 by 512 matrix. One other factor is the desired smoothness of the interpolator. Clearly at this point you can add your own cleaning method, but if you are using this class chances. The data set is large (110k nodes). I want to specify that scatteredInterpolant worked well in a script but not in the simulink function block My scattered model data are 3 . 184942 0. You can evaluate F at a set of query points, such as (xq,yq) in 2-D, to produce interpolated values vq = F (xq,yq). The choice of a specific interpolation routine depends on the data: whether it is one-dimensional, is given on a structured grid, or is unstructured. The griddatan function supports scattered data interpolation in N-D; however, it is not practical in dimensions higher than 6-D for moderate to large point sets, due to the exponential growth in memory required by the underlying triangulation. When I did that step, command window shows " Requested 61890x61890 (28. La interpolación es una técnica que se utiliza para agregar nuevos puntos de datos dentro del rango de un conjunto de puntos de datos conocidos. You can evaluate F at a set of query points, such as (xq,yq) in 2-D, to produce interpolated values vq = F (xq,yq). scatteredInterpolant returns the interpolant F for the given data set. . cosmoscalibur. 974 5333045. x = sort (20*rand (100,1)); v = besselj (0,x); Create a gridded interpolant object for the data. interpolate. F = scatteredInterpolant (Xcoor, Ycoor, Zcoor,Cvapor); scatter3 (px,py,pz,4,F (px,py,pz),'filled');R equivalent to matlab griddata, scatteredInterpolant, and/or TriScatteredInterp. It faithfully preserves input data values and produces a continuous a surface as its output. Interpolant surface fits use the MATLAB ® function scatteredInterpolant function for none, linear, and nearest neighbor extrapolation, and the MATLAB function griddata for biharmonic extrapolation. The first output FX is always the gradient along the 2nd dimension of F, going across columns. Interpolation and Extrapolation of Randomly Scattered data to Uniform Grid in 3D. The integration was unsuccessful. The surface always passes through the data points defined by x and y. this will generate X and Y of n by n. . qhull is a third-party library; if I recall correctly it is from a UK university. random(100) y = np. A scattered data set is defined by sample points X and corresponding values v. You CANNOT use interpolation with three independent variables, when one of them is IDENTICALLY zero. 10. You can see the equation that i have mentioned. class scipy. I process the data:scatteredInterpolant Scattered data interpolation scatteredInterpolant performs interpolation on scattered data that resides in 2-D or 3-D space. Use griddedInterpolant to perform interpolation with gridded data. scatteredInterpolant returns the interpolant F for the given data set. My question is : can we speed up the scatteredinterpolant function by using it with parallel too. Can I define the iregular geometry of the map as queery points so that there would no contour lines outside the map?scipy. If you use git subrepo, you can clone the source into your externals directory and use it from there. See the syntax, input arguments, properties, and usage examples of this function in MATLAB. v in the ScatteredInterpolant is just your data values at the x and y locations. arange(0,1. There is a high density of values scattered around in the center of the 3D space. If you believe scatteredInterpolant is computing the wrong answer but cannot share the data with the community, please send your call to scatteredInterpolant along with the data necessary to execute that call and a description of why you believe its answer is incorrect (such as the results from a different interpolation routine) to Technical. A scattered data set defined by locations X and corresponding values V can be interpolated using a Delaunay triangulation of X. That is, for each 5 pixels in the original image, the interpolated image has 6 pixels. problem with scatteredInterpolant: are there any limits? min (x) = 417740; max (x) = 417870; min (y) = 4177412; max (y)= 5333100; min (z)= 0; max (z) = 11054;. extrinsic. Syntax: VI = scatteredInterpn(X. 048 1636. Method = 'natural'; zi= f(xi,yi); My problem is that the ScatteredInterpolant function struggles to output sensible values outside of the contour lines. If you attach the data, then I could suggest better tools. Aykut Ayca on 27 Sep 2019. Learn more about scatteredinterpolant i have been trying to interpolate the wind speed of a known location on a meshed grid with changing sampe values (wind speed) recorded at weather station locations, the function below works for one. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects. It is possible to fit a single polynomial interpolant to data, with a degree one less than the number of data points. Francesc Purroy on 12 Nov 2018. Please take a look at Delaunay and Trisurf functions in matlab. The scatteredInterpolant class described in Interpolating Scattered Data Using the scatteredInterpolant Class is more efficient in this respect. I was using it for my research but after some playing around it seems to just be. scipy. interpolate import griddata # data coordinates and values x = np. As of version 0. How to use scatteredInterpolant in case of. . It is written in C, C++, Java and. 9. Surf produces a pretty smooth surface, whereas with trisurf streaks start appearing. Use griddedInterpolant to perform interpolation. You can specify a point outside the convex hull of your scattered data and will still not get a NaN. For computational purposes, I need to resample them over a grid with a used-defined space discretization (say, 5 m). Edited: Alexander Schwarzwälder on 23 Nov 2020. This example shows how to extrapolate a well sampled 3-D gridded dataset using scatteredInterpolant. Currently. 您可以使用插值来填充缺失的数据、对现有数据进行平滑处理以及进行预测等。. GitHub is where people build software. 208 1744. random(100) z = np. . Quick summary. " Does this mean that the function discovered duplicate (x,y) grid points in my inputs, or that some adjacent z-points are duplicated?scatteredInterpolant supports (x, y, v, then options, or (x, y, z, v, then options, so building an interpolation object over 2d or over 3d, that you then invoke with the appropriate number of input parameters to get results. 插值是在一组已知数据点的范围内添加新数据点的技术。. 000 417826. You can evaluate F at a set of query points, such as (xq,yq) in 2-D, to produce interpolated values vq = F (xq,yq). X, Y, and Z contain the coordinates of the sample points. I have three column vectors (lat,long,temp) referred to as F(:,1) F(:,2) and F(:,3). You can provide the inputs in that form rather than a mxn array. scatteredInterpolant returns the interpolant F for the given data set. I was wondering if anyone would know any alternative function to scatteredInterpolant (if possible that can be implemented also in Python) so that it can be equivalent to the one I show below. function data_out = test_scatteredInterpolant (data_input) U = rand (20,20); V = rand (20,20);Vq = interp3(X,Y,Z,V,Xq,Yq,Zq) returns interpolated values of a function of three variables at specific query points using linear interpolation. Learn more about data, type, precision, input, arguments, cast, casting MATLABNatural-neighbor interpolation is a fast, robust, and reliable technique for reconstructing a surface from irregularly distributed sample points. To install, run. 0. scatteredInterpolant will. example. ). For example, I have the following non-gridded data points, known v = F(x,y),. Interpolating scattered data using scatteredInterpolant. The interpolation will change slightly however, because in Cartesian you pretend that the lines connecting the neighbors are straight, and in polar, they are curved (from a Cartesian viewpoint). interpn expects gridded data in a full grid format, which is not what your Y represents, at least in its current form. 974 5333045. I get the following warning from scatteredInterpolant. Hi, I am kind of struggling with scattered interpolation in Julia for 2D. I was wondering if this process itself can be done in parallel processing because it takes VERY long for decently high resolutions (up to a hour for a 512x512x512 grid, which of course isn't trivial) I've written a code that uses TriScatteredInterp, but I read in Matlab's documentation that this will not be supported in future release and that I should instead use scatteredInterpolant. Sign in to answer this question. Learn more about scatteredinterpolant: MATLAB the xyz data file consists out of 3157394 data triples like this: 417826. The solutions take a long time to run. Accepted Answer: Voss. slx' (which uses the 'scatteredInterpolant' object created in MATLAB workspace) and MATLAB script 'scatterInterpolantObj. Parameters: pointsndarray of floats, shape (npoints, ndims); or Delaunay. The Analytic, Interpolation, and Piecewise functions can also be added to Materials. 000 417826. eps= (235/fy)^ (1/2); % required for section classification. 您可以使用插值来填充缺失的数据、对现有数据进行平滑处理以及进行预测等。. As to the difference between griddata and scatteredInterpolant the main difference as I understand it is that the latter gives you a function that you can effectively call multiple times and re-use the triangulation that both methods use to interpolate, while repeated. Answered: Cris LaPierre on 5 Aug 2021. Show -1 older comments Hide -1 older comments. Use scatteredInterpolant to perform interpolation on a 2-D or 3-D data set of scattered data . Its still not working. scatteredInterpolant contains data and it behaves like an array—in MATLAB language, it is called a value object. Connect and share knowledge within a single location that is structured and easy to search. However, it is rather time consuming to perform the triangulation every time I use the file. I have a shape defined by a point cloud. A simple way around is to add some noise to your data as with randn then ScatterInterpolant does not consider the values to be equal and it works for me. however, as scatteredInterpolant requires at least 2 dimensions for its indices, this doesn't work for 1d interpolation. I have to interpolate the data in it. You can evaluate F at a set of query points, such as (xq,yq) in 2-D, to produce interpolated values vq = F (xq,yq). The subject line could equally. however, as scatteredInterpolant requires at least 2 dimensions for its indices, this doesn't work for 1d interpolation. When I did that step, command window shows " Requested 61890x61890 (28. scipy. In a previous discussion Kelly provided a means to convert a scattered vector to gridded. This produces a surface of the form V = F (X). PchipInterpolator(x, y, axis=0, extrapolate=None) [source] #. Notably it is smooth almost everywhere whereas linear interpolation is only piecewise linear. V contains the corresponding function values at each sample point. scatteredInterpolant takes a set of sample points and returns what is essentially a function handle that can take a new point and return an interpolated value. For the third output FZ and the outputs that follow, the Nth output is the gradient along the Nth dimension of F. (PCHIP stands for Piecewise Cubic Hermite Interpolating. % Section Classification Flange width to thickness ratio in compression. RegularGridInterpolator(points, values, method='linear', bounds_error=True, fill_value=nan) [source] #. Keep in mind that gridded data must include all data points on the grid: as. The. Assuming I have some scattered points; then I used scattered interpolant to having a 0. Surface plots are useful for visualizing matrices that are too large to display in numerical form and for graphing. Hello, I want to call the value F_a(Mach,he) with Simulink. Your data lies in the plane (x1,y1,0). I am quite sure that this is not the case since you used an analytical description of the ellipse and plotted it overlaying the contourf plot. Piecewise polynomials with lower-order segments do not diverge significantly from the. Más respuestas (1) In some cases you can have a set of x and y data where the values of x and/or y are repeated as Aristo was showing. The values it returns for. T(goodT),P_FE(goodT)); Now, if I recreate your filled contour plot, things get a little better, because I tossed a lot of the crap in the bit bucket. It is also significantly faster than","% this function and have support for extrapolation. The MATLAB language is designed to give optimum performance when your application is structured into functions that reside in files. Learn more about scatteredinterpolant: MATLAB the xyz data file consists out of 3157394 data triples like this: 417826. 01 c=2. The griddatan function interpolates the surface at the query points specified by xq and returns the interpolated values, vq. 0000 value in temperature column representing NaN or missing data. The 'linear' extrapolation method is based on a least-squares approximation of the gradient at the boundary. Selecting an Extrapolation Methodclass scipy. Link. The MATLAB language is designed to give optimum performance when your application is structured into functions that reside in files. x = [1. My data points are scattered data in three dimension. Piecewise linear interpolant in N > 1 dimensions. One point to still remember is that the normalization of the coordinate-points (centering and dividing by the standard deviation of the coordinates) is often very helpful in removing the. % Load Point Cloud: Point_Cloud = importdata (‘Point_Cloud_1. This allows the object to continue using the same triangulation it built when it was originally constructed, which is a lot of the work involved in creating the object. griddedInterpolant evaluates each page in the 3-D image at. I would like to simulate scatteredInterpolant by constructing delaunay triangulation of X, computing the barycentric weights of Q, and use the above results to interpolate the function values. I tried it using "scatteredInterpolant", but the results were quite bad. This would be akin to filtering a full 2-D array using the 'replicate' argument as opposed. if got a three vectors of scattered x, y and z data. x = sort (20*rand (100,1)); v = besselj (0,x); Create a gridded interpolant object for the data. One other factor is the desired smoothness of the interpolator. 125) ans = 0. 01 -160. This discussion applies in any dimensionality. scatteredInterpolant is used to perform interpolation on a scattered dataset, which is basically what you have. Interp (3. scatteredInterpolant seems to do the job quite well for grid points within the boundaries of the original cloud; however, I still need the grid points falling outside the limits of the original dataset to be NaNs. Prototyping at the command line may not yield the same level of performance. ". arrays; matlab; statistics;Matlab can perform interpolation as well as extrapolation on a scatteredInterpolant object. Interpolating contour plot using user input. I haven't tried the inpaint_nans function yet, but will do so and see how it compares. scatteredInterpolant 类支持二维和三维空间中的散点数据插值。可以通过调用 scatteredInterpolant,传递插值点位置和对应值,并使用内插和外插方法作为可选参数,来创建插值。有关可用于创建和计算 scatteredInterpolant 的语法的详细信息,请参阅 scatteredInterpolant 参考页。 This transforms the data so that the original mean μ becomes 0, and the original standard deviation σ becomes 1: x = ( x − μ) σ. Type erased AnyInterpolator container can hold each of the implemented interpolators. By default, griddedInterpolant uses the 'linear' interpolation method. Others have suggested extrapolation. griddedInterpolant returns the interpolant F for the given data set. Use griddedInterpolant to perform interpolation with gridded data. I have created a 2D contour map using a 25x19 matrix and was wondering how to interpolate the value at certain user-input x-y coordinates? Essentially, I want the user to enter coordinates that are either integer or decimal, and for the code to output the value at that corresponding location. I need your help with one of my problems. It is straightforward to do so with numpy, scipy. Learn more about interpolation, interpn, multivariate, optimization, numerical interpolation, griddatan MATLABAs far as I know, I know interp2,interp,griddata,scatteredInterpolant and other functions can achieve my non-aligned regular grid data for mapping, but the efficiency is very low, on the contrary, the remap function in opencv is very fast and only does mapping projection. Interpolate Two Sets of 2-D Sample Values. In a previous discussion Kelly provided a means to convert a scattered vector to gridded information, but it can potentially take up a lot of memory. 912 etc etc. So I did, and found to be twice slower for a 512 by 512 matrix. 2 Answers. Create a single mesh which holds values calculated from both scatteredinterpolants, but squeeze a row of nans along the discontinuity. 07 c=4. These tools work via triangulations of the domain - Delaunay triangulations, which result in convex things. I want to specify that scatteredInterpolant worked well in a script but not in the simulink function block. To fix this on a code level, you could switch to interpreted MATLAB code. values ndarray of float or complex, shape (n,). Theme. There are several general facilities available in SciPy for interpolation and smoothing for data in 1, 2, and higher dimensions. Scattered data interpolation ( griddata) # Suppose you have multidimensional data, for instance, for an underlying function (f (x, y)) you only know the values at points (x [i], y. 15, 3. The outer boundary surface of a Delaunay triangulation is in fact the convex hull of the data. 24 25. random(100) # target grid to interpolate to xi = yi = np. It also looks like my interpolant to a regular grid isn't working?Hello, I am currently doing EEG traceability research, because I only have the subject’s EEG data and no MRI data, so I used the MRI template. [X,Y]=meshgrid (x,y). x y z data -12. 3 3; 3 3. Options are "linear" or "nearest". However, before doing that, I created a mesh as a querry points. F = scatteredInterpolant(map. griddedInterpolant 返回给定数据集的 插值 F 。. I am doing data interpolation using scatteredinterpolant method. Learn more about interpolation, griddata, scatteredinterpolant Hello, I have a quite large dataset of about 57 million uniformly gridded density samples in 3D space (four column vectors x, y, z and d of length 5. Scattered data interpolation methods for electronic imaging systems: a survey Isaac Amidror Laboratoire de Syste`mes Pe´riphe´riques Ecole Polytechnique Fe´de´rale de LausannescatteredInterpolant contains data and it behaves like an array—in MATLAB language, it is called a value object. You should have a look whether your ellipse is matching the used grid for plotting. 18sec , griddenInterpolant:4. Strictly speaking, not all regular grids are supported - this function works on rectilinear grids, that is, a rectangular grid with even or uneven spacing. XV = [. The query points lie on a planar grid that is completely outside domain. Vector x contains the sample points, and v contains the corresponding values, v ( x ). LinearNDInterpolator(points, values, fill_value=np. See the above example with nine points that represent four axis-parrallel elements. Q&A for work. My Release is from 2011, so I do not have the ScatteredInterpolant () function in Matlab, to do the Extrapolation. Walter Roberson on 9 Dec 2015. The answer is, first you interpolate it to a regular grid. I'm sorry, but you simply cannot use scatteredInterpolant to produce a meaningful result from this data, as you are trying to do. Create a vector of scattered sample points v. 1. X,contour_grid. Thus, since scatteredInterpolant will only provide at best a piecewise linear surface, you may want to use a tool like griddata or my own gridfit. In this case will be F = scatteredInterpolant (x,y,v), which the function itself is trying to get the F in v = F(x,y). What I have is a matrix of x, y, z points that is my base data.