资源简介
matlab曲面拟合,强烈推荐,函数特别适合空间点的曲面拟合,matlab对于此类数据点似乎只能用griddata差值计算,且效果不怎么好;至于B样条拟合,其外扩数据点的选取不是一般的matlab用户所能掌握的,同时对于非网格数据的转换也是一个问题。
代码片段和文件信息
function [zgridxgridygrid] = gridfit(xyzxnodesynodesvarargin)
% gridfit: estimates a surface on a 2d grid based on scattered data
% Replicates are allowed. All methods extrapolate to the grid
% boundaries. Gridfit uses a modified ridge estimator to
% generate the surface where the bias is toward smoothness.
%
% Gridfit is not an interpolant. Its goal is a smooth surface
% that approximates your data but allows you to control the
% amount of smoothing.
%
% usage #1: zgrid = gridfit(xyzxnodesynodes);
% usage #2: [zgridxgridygrid] = gridfit(xyzxnodesynodes);
% usage #3: zgrid = gridfit(xyzxnodesynodespropvalpropval...);
%
% Arguments: (input)
% xyz - vectors of equal lengths containing arbitrary scattered data
% The only constraint on x and y is they cannot ALL fall on a
% single line in the x-y plane. Replicate points will be treated
% in a least squares sense.
%
% ANY points containing a NaN are ignored in the estimation
%
% xnodes - vector defining the nodes in the grid in the independent
% variable (x). xnodes need not be equally spaced. xnodes
% must completely span the data. If they do not then the
% ‘extend‘ property is applied adjusting the first and last
% nodes to be extended as necessary. See below for a complete
% description of the ‘extend‘ property.
%
% If xnodes is a scalar integer then it specifies the number
% of equally spaced nodes between the min and max of the data.
%
% ynodes - vector defining the nodes in the grid in the independent
% variable (y). ynodes need not be equally spaced.
%
% If ynodes is a scalar integer then it specifies the number
% of equally spaced nodes between the min and max of the data.
%
% Also see the extend property.
%
% Additional arguments follow in the form of property/value pairs.
% Valid properties are:
% ‘smoothness‘ ‘interp‘ ‘regularizer‘ ‘solver‘ ‘maxiter‘
% ‘extend‘ ‘tilesize‘ ‘overlap‘
%
% Any UNAMBIGUOUS shortening (even down to a single letter) is
% valid for property names. All properties have default values
% chosen (I hope) to give a reasonable result out of the box.
%
% ‘smoothness‘ - scalar - determines the eventual smoothness of the
% estimated surface. A larger value here means the surface
% will be smoother. Smoothness must be a non-negative real
% number.
%
% Note: the problem is normalized in advance so that a
% smoothness of 1 MAY generate reasonable results. If you
% find the result is too smooth then use a smaller value
% for this parameter. Likewise bumpy surfaces suggest use
% of a larger value. (Sometimes use of an iterative solver
% with too small a limit on the maximum number of iterations
% will result in non-convergence.)
%
% DEF
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6148 2006-08-17 14:17 quxiannihe\.DS_Store
文件 43153 1994-07-12 12:38 quxiannihe\bluff_data.mat
文件 6148 2006-08-22 11:45 quxiannihe\demo\.DS_Store
文件 3526 2006-08-22 11:36 quxiannihe\demo\gridfit_demo.m
文件 11998 2006-08-22 11:44 quxiannihe\demo\html\gridfit_demo.html
文件 5820 2006-08-22 11:44 quxiannihe\demo\html\gridfit_demo.png
文件 9636 2006-08-22 11:38 quxiannihe\demo\html\gridfit_demo_01.png
文件 106358 2006-08-22 11:38 quxiannihe\demo\html\gridfit_demo_02.png
文件 11720 2006-08-22 11:38 quxiannihe\demo\html\gridfit_demo_03.png
文件 116439 2006-08-22 11:38 quxiannihe\demo\html\gridfit_demo_04.png
文件 106454 2006-08-22 11:38 quxiannihe\demo\html\gridfit_demo_05.png
文件 127375 2006-08-22 11:38 quxiannihe\demo\html\gridfit_demo_06.png
文件 106871 2006-08-22 11:38 quxiannihe\demo\html\gridfit_demo_07.png
文件 56282 2006-08-22 11:38 quxiannihe\demo\html\gridfit_demo_08.png
文件 52377 2006-08-22 11:38 quxiannihe\demo\html\gridfit_demo_09.png
文件 70654 2006-08-22 11:44 quxiannihe\demo\html\gridfit_demo_10.png
文件 9443 2006-08-22 10:34 quxiannihe\doc\Understanding_gridfit.rtf
文件 33939 2006-08-06 09:34 quxiannihe\gridfit.m
文件 44689 2005-11-11 07:34 quxiannihe\ravine.jpg
文件 0 2012-11-04 22:03 quxiannihe\readme.txt
文件 6148 2006-08-22 11:36 quxiannihe\test\.DS_Store
文件 5404 2006-08-22 11:36 quxiannihe\test\test_main.m
目录 0 2007-07-09 11:32 quxiannihe\demo\html
目录 0 2007-07-09 11:32 quxiannihe\demo
目录 0 2007-11-02 13:48 quxiannihe\doc
目录 0 2007-07-09 11:32 quxiannihe\test
目录 0 2012-11-04 22:03 quxiannihe
----------- --------- ---------- ----- ----
940582 27
............此处省略0个文件信息
评论
共有 条评论