![]() Also notice that the interpolated surfaces have empty regions near the corners due to the sparsity of contour data at those points. Notice that there is little difference between the two results (at least at this scale). Title('TriScatteredInterp reconstruction') ZI = griddata(Xc,Yc,Zc,XI,YI) % Interpolate surfaceį = TriScatteredInterp(Xc(:),Yc(:),Zc(:)) % Generate interpolant These contour lines could be stored in geodatabase so that they. The contour plot object id from which to retrieve the isoline(s). In fact, when surfer interpolates the points, we have both contour lines and 3D surface model. = meshgrid(linspace(-3,3,21)) % Generate a uniform grid You can use a choropleth maps when your data are (1) attached to enumeration units (e. % Format the coordinate data for the contours: The contour data was generated with the contour function: % First plot: Here's some sample code and the resulting figure it generates for reconstructing a surface from contour data using both methods above. ![]() The interpolant F is then evaluated using the matrices XI,YI that you must create using meshgrid. Where x,y,z again represent vectors of the cartesian coordinates for each point, only this time I've used a colon reshaping operation (:) to ensure that each is a column vector (the required format for TriScatteredInterp). The new values returned for the matrices XI,YI are the same as the result of passing XI,YI to meshgrid to create a uniform grid of points. The row vector XI and column vector YI are the cartesian coordinates at which griddata interpolates the values ZI of the fitted surface. Where x,y,z each represent vectors of the cartesian coordinates for each point (in this case the points on the contour lines). Both of these allow you to fit a surface of regularly-spaced data to a set of nonuniformly-spaced points (although it appears griddata is no longer recommended in newer MATLAB versions). In MATLAB you can use either the function griddata or the TriScatteredInterp class (Note: as of R2013a scatteredInterpolant is the recommended alternative).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |