下载此文档

matlab程序曲面拟合.docx


文档分类:IT计算机 | 页数:约11页 举报非法文档有奖
1/11
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/11 下载此文档
文档列表 文档介绍
%Gridfitdemoscript%Thisscriptfileisdesignedtobeusedincellmode%fromthematlabeditor,orbestofall,usethepublish%%ofmatlabcancopyandpasteentireblocksofcodeinto%;x=bluff_data(:,1);y=bluff_data(:,2);z=bluff_data(:,3);%%(x,y,z,'.')%Turnthescannedpointdataintoasurfacegx=0:4:264;gy=0:4:400;g=gridfit(x,y,z,gx,gy);figurecolormap(hot(256));surf(gx,gy,g);camlightright;lightingphong;shadinginterpline(x,y,z,'marker','.','markersize',4,'linestyle','none');title'ontourstorecreateasurface'Fittingatrigonometricsurfaceclearn1=15;n2=15;theta=rand(n1,1)*pi/2;r=rand(1,n2);x=cos(theta)*r;y=sin(theta)*r;x=x(:);y=y(:);x=[[0011]';x;x;1-x;1-x];y=[[0101]';y;1-y;y;1-y];figureplot(x,y,'.')title'Datalocationsinthex-yplane'z=sin(4*x+5*y).*cos(7*(x-y))+exp(x+y);xi=linspace(0,1,51);[xg,yg]=meshgrid(xi,xi);zgd=griddata(x,y,z,xg,yg);figuresurf(xi,xi,zgd)colormap(hot(256))camlightrightlightingphongtitle'Griddataontrigsurface'%Notethewing-likeartifactsalongtheedges,due%=gridfit(x,y,z,xi,xi);figuresurf(xi,xi,zgrid)colormap(hot(256))camlightrightlightingphongtitle('Gridfittotrigsurface')Thetrigsurfacewithhighlydifferentscalingsonthexandyaxesxs=x/100;xis=xi/100;ys=y*100;yis=xi*100;%griddatahasproblemswithbadlyscaleddata[xg,yg]=meshgrid(xis,yis);zgd=griddata(xs,ys,z,xg,yg);figuresurf(xg,yg,zgd)colormap(hot(256))camlightrightlightingphongtitle'riddataonbadlyscaledtrigsurface'%autoscalingon(thedefault)zgrids=gridfit(xs,ys,z,xis,yis,'autoscale','on');%plottheautoscaledresultfiguresurf(xis,yis,zgrids)colormap(hot(256))camlightrightlightingphongtitle'Gridfit(automaticallyscaled)ontrigsurface'Warning:Duplicatex-ydatapointsdetected:"peaks"surfaceclearn=100;x=(rand(n,1)-.5)*6;y=(rand(n,1)-.5)*6;z=peaks(x,y);xi=linspace(-3,3,101);zpgf=gridfit(x,y,z,xi,xi);[xg,yg]=meshgrid(xi,

matlab程序曲面拟合 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数11
  • 收藏数0 收藏
  • 顶次数0
  • 上传人wz_198613
  • 文件大小763 KB
  • 时间2019-11-19