Triscatteredinterp. interpolate import griddata # data coordinates and values x = np. Triscatteredinterp

 
interpolate import griddata # data coordinates and values x = npTriscatteredinterp  Use griddedInterpolant to perform interpolation

The constraints will be lost if the TriScatteredInterp is saved and loaded. Learn more about triscatteredinterp, interpolation, 3d, lines, surface MATLAB I am trying to compute a surface from 3 lines using interpolation and not getting the expected results. . Hi, im wondering why querying the TriScatteredInterpolant is so much slower and so much more size dependent than griddedInterpolant. I have three vectors: x,y (point coordinates) and v (fluid values). 这两个函数功能是相同的,不过TriScatteredInterp是老版函数,MATLAB文档上不推荐使用。函数功能插入二维或三维散点数据使用 scatteredInterpolant 对散点数据的二维或三维数据集执行插值。scatteredInterpolant 返回给定数据集的插值函数 F。可以计算一组查询点(例如二维 (xq,yq))处的 F 值,以得出插入的值 vq. The column vector V defines the values at X, where the length of V. Historically, the MATLAB approach was to use qhull to produce a triangulation, and then for each query point, query which triangle it was in and use the vertices of the triangle to do the interpolation. . Updated 27 Nov 2012. 04, but both scatteredInterpolant and TriScatteredInterp return values of -85. (So use interp2 . )I have a program where I load multiple 2d aerofoil sections from text files. F = TriScatteredInterp(DT,V) uses the specified DelaunayTri object DT as a basis for computing the interpolant. the cyclist on 14 Feb 2012. clear all; % Create x- and y-coordinates of three random points in the 2D plane. TriScatteredInterp from 3 lines to get surface. I'm wondering if anyone else has had problems using constrained 2D Delaunay triangulations to create TriScatteredInterp objects, and if anyone has a suggested work-around. Learn more about scattered data, interpolation, triscatteredinterp Hi guys, I want to interpolate 2d scattered data from a CFD simulation to a regular grid using matlab's TriScatteredInterp. The example in the linked documentation of TriScatteredInterp will do exactly what you need, all you need to do is replace x, y, and z by your data and define the. F = TriScatteredInterp (X, V) creates an interpolant that fits a surface of the form V = F (X) to the scattered data in (X, V). One-dimensional interpolation. F = TriScatteredInterp(X, V) creates an interpolant that fits a surface of the form V = F(X) to the scattered data in (X, V). Gnu Octave, Get every nth row of a matrix/vector: Now, remove rows from the original matrix which will give you a list of the rows not extracted. . Unfortunately I don't know what you should use for that situation, so maybe someone else will chime in here. So I've used function F=TriScatteredInterp (x,y,z,'method') to create the interpolant F. X . X is a matrix of size mpts-by. % chords = The. Notice that there are jagged edges near the corners of the surface. It won't work to fit a point cloud like you have. Copy. . # I create "interpolazione. DT is a Delaunay triangulation of the scattered data locations, DT. As my initial data had quite a few NaN values, the final interpolation incorrectly created an entire array of NaNs. Then do Barycentric interpolation in a triangle as shown in. 29. I have 3 columns, an X coordinate, a Y coordinate, and a column of values (in this case salinity) measured at the X Y locations. Then it evaluates the interpolant at different locations (val=F(x,y)). X is of size mpts -by- ndim , where mpts is the number of points and ndim is the dimension of the space where the points reside, 2 <= ndim <= 3 . Overview; Functions. X is a matrix of size mpts-by-ndim, where mpts is the number of points and ndim is the dimension of the space where the points reside (ndim is 2 or 3). I have x,y,z data. triangle_obj 1x1 540 TriScatteredInterp u 15x1 120 double X 15x1 120 double Y 15x1 120 double Try the approach below. Here are some of the ways. I tested both TriscatteredInterp, and scatteredInterpolant on a large set of data, interpolating 1e7 points through a random surface compiosed of 10000 points in 2-dimensions. For 3-D interpolation, the inputs x, y, and z define the points where the function v = f (x, y, z) is evaluated. F = TriScatteredInterp(X, V) creates an interpolant that fits a surface of the form V = F(X) to the scattered data in (X, V). Image 1 - Plot of the imported data. Using the data from the example above:TriScatteredInterp Issues - Function to Fit Data. However, from the data you show, it seems that they are not really sampled in a grid, i. Hi, im wondering why querying the TriScatteredInterpolant is so much slower and so much more size dependent than griddedInterpolant. Additionally, the interpolation is not tensorially separable in the scattered case. And this happens even if I'm using linear interpolation on double numbers in the cartesian to sperical conversion and using nearest neighbour in TriScatteredInterp. I've been having a problem with TriScatteredInterp in version R2009a where I erratically obtain NaN values for my output value. . qhull is a third-party library; if I recall correctly it is from a UK university. xls',1); xd2=xlsread('3dcr. Saltar al contenido. It does relatively well at calculating the area, in this case it's <1% off, but I'd like it to get even better than that. factor (numel (s)) Multiply these factors any way you want to produce 3 non prime values. interpolate. griddata, and matplotlib. . I want to interpolate these points but they are not evenly distributed so I could not use interp1. Piecewise linear interpolant in N > 1 dimensions. Use *TriScatteredInterp* instead. Learn more about triscatteredinterp, delaunaytri Hi, I have several routines where I create a TriScatteredInterp object from a DelaunayTri that has constraints on it. 一、 实验要求. E. 8, which doesn't make sense at all. I tried to interpolate a set of radar reflectivity values using TriScatteredInterp (and later with scatteredInterpolant). Learn more about extrapolation, triscatteredinterp hello everybody I wonder why Mathworks considers TriScatteredInterp(x,y,z) as an extrapolation function while it only interpolates inside the area defined by "x,y" scattered points and it doesn'. 3D extrapolation without ScatteredInterpolant. For 3-D interpolation, the inputs x, y, and z define the points where the function v = f (x, y, z) is evaluated. . . Learn more about triscatteredinterp, simulink, simulink . This example shows how to interpolate three 1-D data sets in a single pass using griddedInterpolant. TriScatteredInterp was the predecessor to scatteredInterpolant and griddata the predecessor to TriScatteredInterp. " I want to know how interpolate the scattered data over the non- uniform grid ( for the trapezoid region) % X coordinate of scatered data. My Objective: I wish to use the stream3 Matlab pre-built-in function. F = TriScatteredInterp(DT,V) uses the specified DelaunayTri object DT as a basis for computing the interpolant. The matrix DT. In this tutorial, we are going to use a visual summary tool for rejecting bad. One-dimensional interpolation. The only difference in my code was just using:Using TriScatteredInterp() I can plot nice looking mesh grids at each range bin. These are both in degrees. Both of these allow you to fit a surface of. Add a comment | 1 Answer Sorted by: Reset to default 1 Here is a way to split the data as you suggested:. 1. X. . Then, for all your desired grid points x', y', please search the triangle in which your x',y' is located. % section. X is of size mpts -by- ndim , where mpts is the number of points and ndim is the dimension of the space where the points reside, 2 <= ndim <= 3 . X is a matrix where each row is a copy of x, and Y is a matrix where each column is a copy of y. Learn more about scattered data, interpolation, triscatteredinterp Hi guys, I want to interpolate 2d scattered data from a CFD simulation to a regular grid using matlab's TriScatteredInterp. 'akima' only does x,y,V (not, x,y,z,V,. A scattered data set defined by locations X and corresponding values V can be interpolated using a Delaunay triangulation of X. Using 'natural' or 'nearest' does produce realistic results. Learn more about volume, triscatteredinterp, 4d model I have a 4D model that I created of a nearby marsh that contains heavy metals. Copy. I see no reason why your grids of 1300 and 7500 points should be problematic (unless you mean an extent of 7500 points. You can see under the "definition" section of TriScatteredInterp :F = TriScatteredInterp(Speed, Acceleration, Frequency); % Takes the raw data, and produces an interpolant. And now I'm able to evaluate value of F at any point. Link. I have been looking for a C# (C or C++ equivalents are fine too) equivalent of Mathlabs TriScatteredInterp or scatteredInterpolant methods. {"payload":{"allShortcutsEnabled":false,"fileTree":{"fvcom_prepro":{"items":[{"name":"samples","path":"fvcom_prepro/samples","contentType":"directory"},{"name":"FVCOM. Having enough input (scattered) data points also helps. TriScatteredInterp doesn't extrapolate. The inputs x, y, z are either vectors of the same length, or. The matrix DT. 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. random. inter_data = F (a,b); Where x,z,y is measured data and inter_data,a,b are numbers. A marker is plotted at each point defined by the coordinates in the vectors x, y, and z . Since you have some raw data values which presumably do not line up with your grid this adds the additional errors associated with the interpolation. Smooth was introduced in 2006, and smoothdata in 2017. These are "flat" surfaces that use color to show the power from each data point. Specifically, the 'scatteredInterpolant' function defaults to the extrapolation method of 'linear' when the interpolation method is 'linear' or 'natural' and the extrapolation method of 'nearest. Saltar al contenido. There are a few gaps in it. 1. The matrix DT. There is no use of multiple cores, even today, using R2022b. Use the contour () function. The matrix DT. Theme. Use your ix variable to do it on the specified columns: That will make X a list of the rows that have not been extracted. make an interpolant from the data: F = TriScatteredInterp (r,Z,sigma); make a grid of z and r points: [rgrid,Zgrid] = meshgrid (linspace (min (r),max (r)),linspace (min (Z),max (Z))); evaluate the interpolant (1) on the grid (2): sigmagrid = F (rgrid,Zgrid); use the gridded data to make a plot: contour (rgrid,Zgrid,sigmagrid) Sign in to answer. I can see this in the Activity mon. Warning from TriScatteredInterp. Gridded data consists of values or measurements at regularly spaced points that form a grid. I've looked into interp2 as well as TriScatteredInterp but neither of these seem to fit my needs exactly. ). Learn more about triscatteredinterp, delaunaytri Hi, I have several routines where I create a TriScatteredInterp object from a DelaunayTri that has constraints on it. Triscatteredinterp outputs an interpolant F that will provide the value of the function at some location (x) in 2D or (x,y) in 3D. The column vector V defines the values at X, where the length of V. if got a three vectors of scattered x, y and z data. 2. . The example below plots a saddle. Learn more about triscatteredinterp . to interpolate on a specified grid. I'm not sure what the commands I'm using are doing) using TriScatteredInterp. If you can post the mesh, I can post code that does the. 0 (0) 318 Downloads. Is there a way to have the fast performance of the griddedinter. Sign in to comment. My hunch is the main issue is TriScatteredInterp used Delaunay triangulation of your data and the holes were meshed in the TriScatteredInterp function. . However, this is a pretty sloppy approximation. 0. Let us consider I have a set of points, which are described as a pair of 2D coordinates. Gridded data arises in many areas, such as meteorology, surveying, and medical imaging. Learn more about scatteredinterpolant MATLABIf you have scattered data, use TriScatteredInterp. I created dimensional variables (x,y,z) that match that grid. For a variety of reasons, I've switched to R. 我还看. the code that. Y)); ymax = max(max(shp. I have a 10018x3 matrix, where each row represents a measurement at a particular (x, y) coordinate. 2D interpolation using TriScatteredInterp (Matlab) Related. x = randn(100,1); y = randn(100,1); get_solution_at_xy(sin(pi*mesh. 以最简单的形式. LinearNDInterpolator(points, values, fill_value=np. And now I'm able to evaluate value of F at any point. 3 次元データから内挿により曲面を推定し、新しい X,Y グリッドデータに対応する値を求めることで、元のデータ点を通る面データを作成することができます。. scatteredInterpolant returns the interpolant F for the given data set. 1. TriScatteredInterp was the predecessor to scatteredInterpolant and griddata the predecessor to TriScatteredInterp. The matrix DT. Unexpected interpolation result when using. inter_data = F (a,b);. I have been looking for a C# (C or C++ equivalents are fine too) equivalent of Mathlabs TriScatteredInterp or scatteredInterpolant methods. That is, the 1st column contains all the x values, the 2nd has all the y values, and the 3rd contains all the measurements. I want to use TRISCATTEREDINTERP for various y such that y=y/100, y=y/10, y=y*10 etc. So I. X is of size mpts-by-ndim, where mpts is the number of points and ndim is the dimension of the space where the points reside, 2 <= ndim <= 3. My hunch is the main issue is TriScatteredInterp used Delaunay triangulation of your data and the holes were meshed in the TriScatteredInterp function. Method of interpolation. for i = 1:length (X) [Lat,Lon ] = utm2deg (Easting ,Northing ,Zone); end [Grid, R] = vec2mtx (Lat, Lon, gridsize); Grid= imbedm (Lat, Lon,z, Grid, R); Maybe you are looking for the. So I've used function F=TriScatteredInterp (x,y,z,'method') to create the interpolant F. Yes, adjusting the step size could help produce a smoother result. F = TriScatteredInterp(DT,V) uses the specified DelaunayTri object DT as a basis for computing the interpolant. Of course, if your company or university if current on maintenance, you can upgrade to the newest release for no additional cost. Your data has huge expanses between those ovals where no information is provided, but a triangulation MUST span the holes. Inputs x, y, z are vectors of the same length or x, y are vectors and z is matrix. X is of size mpts-by-ndim, where mpts is the number of points and ndim is the dimension of the space where the points reside, 2 <= ndim <= 3. Sign in to comment. On Thu, Sep 14, 2017 at 5:58 AM, Lester Anderson <address@hidden> wrote: Hello, I have come across a bit of code I am trying to get to run in Octave, but found the function TriScatteredInterp: Learn more about interp2, triscatteredinterp, interpolation, table MATLAB Hi, I have a table with density values dependent on pressure and temperature, rho(p,T), and I want to be able to interpolate between them. This seems to be the question du jour. X is of size mpts -by- ndim , where mpts is the number of points and ndim is the dimension of the space where the points reside, 2 <= ndim <= 3 . Now to get the values on the non-uniform grid, what is best about triScatteredInterp class is that it works like a function, you can use feval to evaluate like a function handle: say your non-uniform grid points are array q. The matrix DT. Inputs x, y, z are vectors of the same length or x, y are vectors and z is matrix. In the image you can see an example of graph obtained. They are just three vectors indicating the coordinates and the z value. 0. xls',7);Sort the data points into blocks in x-y-z, create a TriScatteredInterp object for each block, and only interpolate inside the relevant block for every new position. 0. (So use interp2 . . Using TriScatteredInterp() I can plot nice looking mesh grids at each range bin. Cambiar a Navegación Principal. Is there a way to have the fast performance of the griddedinter. Votar. (I have attached the point cloud and code to display it on MATLAB here . random. Get interpolated 2D matrix by interpolating layers of 3D matrix in Matlab. Assuming your input data is 'randomly' spaced: >> inputs = randn (400, 2); >> outputs = inputs (:, 1) . 1. I'm using TriScatteredInterp for 3 dimensional interpolation. Points that look close in one direction are in. And now I'm able to evaluate value of F at any point. . View License. Using the data from the example above:Toggle Main Navigation. . Then, find the gradient of z by specifying the spacing between points. . In addition to @Alexandrew answer you can use newer and faster TriScatteredInterp class instead of GRIDDATA. For your exampe you can use 2D IMAGESC instead of 3D MESH. TriScatteredInterp is discussed near the end. The interpolation points are all (xi, yi). TriScatteredInterp is used to perform interpolation on a scattered dataset that resides in 2-D or 3-D space. I want to interpolate this data and fill in those gaps. Hey everyone, I'm using interpolation function to create the following "I": pulse_height = 500E-6; pulse_len = 1E-9; t_rise = 50E-12; t_sim. Thank you very much for your help! clear. I have a 3D point cloud which isn't continuous. Sign In to Your MathWorks Account; My Account; My Community Profile; Link License; Sign Out; Products; SolutionsYou can use the axis keyword to constrain the limits of your contour plot. Conversely, with scattered interpolation, it's harder to figure out which neighbours should participate. Now I understand how TriScatteredInterp works in Matlab. griddata (averaging instead of interpolation) I have many raw data points of a pipe surface that i scanned with a 3D scanner. This is a faster alternative to looping over your data sets. Sliding Window quality filering. Hi I need help converting a line in my code to TriscatteredInterp. So I would like to plot/construct a "volumetric mesh" for multiple range bins. According to the MATLAB documentation, applying the TriScatteredInterp function on a scattered dataset with duplicates will implicitly remove the duplicates and average the associated data values. Inicie sesión cuenta de MathWorks; Mi Cuenta;Interpolation of Multiple 1-D Value Sets. Link. The matrix DT. To preserve the constraints save the DelaunayTri and recreate TriScatteredInterp after loading. %# insert the code from @Alexandrew answer to generate meshgrid [XI, YI] = meshgrid (xi, yi); TSI = TriScatteredInterp (x,y,z); ZI = TSI (XI,YI);. interpolate. X. Inicie sesión cuenta de MathWorks; Mi Cuenta; Mi perfil de la comunidad; Asociar Licencia; Cerrar sesiónDescription. ERROR: Input data must be specified in. The scatteredInterpolant class supports scattered data. Generate a regular mesh from irregular data using interpolation. . In some applications, the interpolation may yield NaN values. Also the ref page for GRIDDATA now suggests you use a new class: "TriScatteredInterp is the recommended alternative to griddata as it is generally more efficient. Stack OverflowLearn more about scattered data, interpolation, triscatteredinterp Hi guys, I want to interpolate 2d scattered data from a CFD simulation to a regular grid using matlab's TriScatteredInterp. Parameters: pointsndarray of floats, shape (npoints, ndims); or Delaunay. F = TriScatteredInterp(X, V) creates an interpolant that fits a surface of the form V = F(X) to the scattered data in (X, V). For example, lets assume I have the. DT is a Delaunay triangulation of the scattered data locations, DT. Smoothdata is a little more sophisticated, with more options, as you might expect, since it was introduced many years later. I have three vectors: x,y (point coordinates) and v (fluid values). I would like to generate a 3d plot of these points, preferably with a mesh-like surface but am having trouble s. Theme. The problem is the power is only interpolated using data from a single range bin, and nothing above or below. All these points, we need to implement Delaunay triangles in C++. Description. Use griddedInterpolant to perform interpolation with gridded data. The data that is being imported is a tab delimited text. . 这两个函数功能是相同的,不过TriScatteredInterp是老版函数,MATLAB文档上不推荐使用。函数功能插入二维或三维散点数据使用 scatteredInterpolant 对散点数据的二维或三维数据集执行插值。scatteredInterpolant 返回给定数据集的插值函数 F。 Yes, adjusting the step size could help produce a smoother result. This decomposition has the property that an arbitrary point P within the region R{i} is closer to point i than any other point. As my initial data had quite a few NaN values, the final interpolation inco. 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. All required data to reproduce this issue is attached and given below. So I did, and found to be twice slower for a 512 by 512 matrix. . Piecewise linear interpolant in N > 1 dimensions. TriscatteredInterp on a multi-core computer. 01,0. In MATLAB you can use either the function griddata or the TriScatteredInterp class (Note: as of R2013a scatteredInterpolant is the recommended alternative). There is a hypothesis that the period is 2π. 0. Learn more about interpolate, triscatteredinterp, for loop, latitude, longitude I am currently having a problem interpolating unevenly spaced grid data. TriScatteredInterp from 3 lines to get surface. class scipy. For time this is a row vector which has 200 entries, thus there are 200 time points in this epoch; For trial this is a matrix with 128 rows and 200 columns, having the voltage for each of the 128 channels and the 200 time points; Cleaning data using visual summaries. F = TriScatteredInterp (X, V) creates an interpolant that fits a surface of the form V = F (X) to the scattered data in (X, V). thanks, Michael 0 Comments. TriScatteredInterp is used to perform interpolation on a scattered dataset that resides in 2-D or 3-D space. Share. R2012b has brung my machine to about all it can do even after adding all the memory it can hold. The edges of the circle are giving quad2d problems, I believe, because of how it is interpolating the data (TriScatteredInterp, linear). I am trying to interpolate wave height data from a large long/lat grid into a smaller set 10 grid points. So it does not make. This is the original line: ReconstructedUS(:,:,bg:en) = griddata3(TGridX, TGridY, TGridZ, US. Replace the zeros with NaN elements, then throw it into inpaint_nans. 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. Use griddedInterpolant to perform interpolation with gridded data. Using TriScatteredInterp() I can plot nice looking mesh grids at each range bin. So I did, and found to be twice slower for a 512 by 512 matrix. If you have scattered data, use TriScatteredInterp. Using TriScatteredInterp to interpolate a image with irregular grid. lat = rand(300, 1); lon = rand(300, 1); ptrend = peaks(lat, lon); % Make a TriScatteredInterp object. Hi, im wondering why querying the TriScatteredInterpolant is so much slower and so much more size dependent than griddedInterpolant. In this case, you may want to try TriScatteredInterp, somewhat like this. . If this is the case, an additional interpolation with nearest-neighbor interpolation (nearest method) is carried out to remove such NaN values on the outlier points. It also gives the appearance of having uniform data whether this is true or not. TriScatteredInterp was the predecessor to scatteredInterpolant and griddata the predecessor to TriScatteredInterp. X is of size mpts-by-ndim, where mpts is the number of points and ndim is the dimension of the space where the points reside, 2 <= ndim <= 3. Utilise les fonctions griddata ou TriScatteredInterp Tu trouveras des exemples en effectuant une recherche sur ce forum. . 2. interpolate. X is a matrix of size mpts-by-ndim, where mpts is the number of points and ndim is the dimension of the space where the points reside (ndim is 2 or 3). The griddata function supports 2-D scattered data interpolation. Conversations. . DT is a Delaunay triangulation of the scattered data locations, DT. . As my initial data had quite a few NaN values, the final interpolation incorrectly created an entire array of NaNs. clear all; % Create x- and y-coordinates of three random points in the 2D plane. What I have is a matrix. I would like to translate *TriScatteredInterp* from *Matlab to C#* and I do these operations but they don’t work. I have 3 variables xd,yd,zd of size 151:3 and I want to interpolate the values of z of size 31:25 for the given input values of x and y size 31:25. 0 (1. I am trying to calculate a triple integral of a function over a body defined as an intersection of two surfaces which I get interpolating data points using TriScatteredInterp or griddata, so they are functions z1(x,y) and z2(x,y). Accepted Answer. Given that you did say your pressures are in a matrix P , it sounds like they're already on a regular X - Y grid. X . If you have scattered data, use TriScatteredInterp. If not specified, x is taken to be the indices of y ( 1:length (y) ). comp. meshgrid(xi,yi. 2. Using TriScatteredInterp to interpolate a image with irregular grid. There is no use of multiple cores, even today, using R2022b. de 2011. The constraints will be lost if the TriScatteredInterp is saved and loaded. If instead you used the original triangulation to do the interpolation, then you should be able to get the desired result. It has a hidden property which is a TriScatteredInterp object -- which only stores the points and does not store any decomposed information. Interpolate input data to determine the value of yi at the points xi. TriScatteredInterp は、2 次元または 3 次元空間にある散布したデータ セットに対して内挿を実行するために使用します。 散布データの集合は、X の位置で定義されるため、対応する値 V は、X の Delaunay 三角形分割を使って計算することができます。 これは、V = F(X) という形式の表面を生成します。F = TriScatteredInterp(DT,V) uses the specified DelaunayTri object DT as a basis for computing the interpolant. " I found this video that talks about the "new" geometric classes in a soothing Irish (?) lilt. GRIDDATA expects the inputs as 1-D vectors. 然而,我似乎无法理解trisurf的工作原理(我尝试过使用它,但运气不佳)。. hello everybody I wonder why Mathworks considers TriScatteredInterp(x,y,z) as an extrapolation function while it only interpolates inside the area defined by "x,y" scattered points and it doesn'. Interpolation is the same operation as table lookup. the amount of points is about 4 times as much as my intended grid points. X . F=TriScatteredInterp(data(:,5),data(:,6)-1); I wish to plot the heatmap from 2 column of data from excel. )Use the utm2deg function on the file exchange and from there a combination of both vec2mtx to make a regular grid and then imbedm to fit the data to the grid. In Matlab I tried with ScatterWindRose (from File Exchange) function, but it is not exactly what I want. Given that you did say your pressures are in a matrix P , it sounds like they're already on a regular X - Y grid. If, and only if, xi is a row vector and yi is a column vector, then meshgrid will be used to create a mesh of interpolation points. Learn more about extrapolation, triscatteredinterp . bin','w'); fwrite (fid,vq,'single'); fclose (fid); In the above code a, b and c are the x, y and z coordinates of each point and d is the corresponding intensity values for the desired range. Worse, use of a tool like a tessellation (Triscatteredinterp) is a obscenely bad way to build that surface. Q is a matrix of size mpts-by-ndim, where mpts is the number of points and ndim is the dimension of the space where the points reside (ndim is 2 or 3). I tried repeating the interpolation by subbing "-50" in for the NaNs (I can erase bad data after), but when.