谁知道这个函数
vanderrow()查了很多地方,都没查到.... matlab中好像没有查到。不知道你是从哪得知? 这是别人编的程序,关于曲面拟合的,看不懂 帮我看看有没有错误 ,那个函数可能是写错了
clear;close;
m=3;n=3;p=1;
x=;y=;
=meshgrid(x,y);
zz=[17.162 17.278 17.409 17.407 17.493 17.503 17.415 17.196 16.853 16.431
15.889 15.995 16.097 16.096 16.171 16.181 16.101 15.906 15.405 15.241
14.651 14.734 14.823 14.822 14.887 14.900 14.825 14.650 14.211 14.076
13.458 13.520 13.598 13.597 13.642 13.647 13.577 13.442 13.061 12.933
12.288 12.341 12.400 12.399 12.136 12.413 13.378 12.261 11.911 11.832
11.153 11.199 11.239 11.239 11.268 11.269 11.218 11.116 10.681 10.763
10.052 10.083 10.117 10.117 10.140 10.134 10.097 10.009 9.8019.725
8.9859.0139.0339.0339.0509.0479.0148.9398.7858.719
7.9627.9807.9967.9957.9997.9917.9607.9157.8017.736
6.9646.9736.9876.9876.9876.9836.9546.9196.8426.794];
function =fit surface(m,n,p,xx,yy,zz)
%m,n are polynomial order, p weighting matrix
close all
X=vanderrow(m);
Y=vanderrow(n);
Y=subs(Y,'x','y');
SXY=X*transpose(Y);
%weighting W
W=ones(m+1,n+1);
XY=SXY.*W;
XY=transpose(SXY(:));
XY=XY(2:length(XY));
%get all coefficients
a=1;
x=xx(:);
Y=YY(:);
z=zz(:);
XY=double(subs(XY));
XY=;
A=pinv(XY)*z.^p;
a=reshape(A,m+1,n+1);
SZ=SXY.*a;
%the symbolic bivariable polynomial to be got by fit
SZ=sum(SZ(:));
%draw a original surface
figure
subplot(2,2,1);
surf(xx,yy,zz);
%colormap();
title('original surface')
%draw the fit surface
x=xx;y=yy;
fZ=double(subs(SZ));
figure
subplot(2,2,2);
surf(x,y,fZ);
%colormap();
title('fit surface')
view(3) 原帖由 red427 于 2007-5-19 11:09 发表 http://www.chinavib.com/forum/images/common/back.gif
这是别人编的程序,关于曲面拟合的,看不懂 帮我看看有没有错误 ,那个函数可能是写错了
clear;close;
m=3;n=3;p=1;
x=;y=;
= ...
估计是自定义的函数,非 matlab 默认的函数,建议自己再找找
页:
[1]