How do I interpolate and plot 3-D surfaces in MATLAB?
94 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2012-9-10
编辑: MathWorks Support Team
2022-10-14
I have vectors "x", "y" and "z" representing the 3 coordinates of points on a 3-D non-linear surface. I would like to interpolate the surface and plot the results.
采纳的回答
MathWorks Support Team
2022-10-14
编辑:MathWorks Support Team
2022-10-14
MATLAB has surface fitting capabilities in the Curve Fitting Toolbox™ that provide an easy way to interpolate and plot surfaces in MATLAB. To learn about interactive surface fitting, please see the following link:
To learn about programmatic surface fit objects, please see the following link:
If you have a MATLAB version prior to R2009a, please read the following for workarounds.
The function GRIDDATA can be used to interpolate and plot data in 3-D as follows:
ZI = griddata(x,y,z,XI,YI) fits a surface of the form z = f(x,y) to the data in the (usually) nonuniformly spaced vectors (x,y,z). GRIDDATA interpolates this surface at the points specified by (XI,YI) to produce ZI. The surface always passes through the data points. XI and YI usually form a uniform grid (as produced by meshgrid).
You can also fit a spline to a surface defined by the data in the same sized matrices "x", "y", and "z", where "x" and "y" are plaid (evenly-spaced) meshes. An example of using the Curve Fitting Toolbox to perform this operation is included in our online documentation starting at the following URL: "Example: Approximation by Tensor Product Splines"
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with Curve Fitting Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!