转载 matlab中griddata函数应用示例 matlab函数调用示例

原文地址:matlab中griddata函数应用示例作者:云梦之殇知道一系列点的坐标如下(1.486,3.059,0.1);(2.121,4.041,0.1);(2.570,3.959,0.1);(3.439,4.396,0.1);(4.505,3.012,0.1);(3.402,1.604,0.1);(2.570,2.065,0.1);(2.150,1.970,0.1);(1.794,3.059,0.2);(2.121,3.615,0.2);(2.570,3.473,0.2);(3.421,4.160,0.2);(4.271,3.036,0.2);(3.411,1.876,0.2);(2.561,2.562,0.2);(2.179,2.420,0.2);(2.757,3.024,0.3);(3.439,3.970,0.3);(4.084,3.036,0.3);(3.402,2.077,0.3);(2.879,3.036,0.4);(3.421,3.793,0.4);(3.953,3.036,0.4);(3.402,2.219,0.4);(3.000,3.047,0.5);(3.430,3.639,0.5);(3.822,3.012,0.5);(3.411,2.385,0.5);(3.103,3.012,0.6);(3.430,3.462,0.6);(3.710,3.036,0.6);(3.402,2.562,0.6);(3.224,3.047,0.7);(3.411,3.260,0.7);(3.542,3.024,0.7);(3.393,2.763,0.7)怎样用MATLAB绘制成三维曲面呢?

使用griddata插值

A=[1.486,3.059,0.1;2.121,4.041,0.1;2.570,3.959,0.1;3.439,4.396,0.1;4.505,3.012,0.1;3.402,1.604,0.1;2.570,2.065,0.1;2.150,1.970,0.1;1.794,3.059,0.2;2.121,3.615,0.2;2.570,3.473,0.2;3.421,4.160,0.2;4.271,3.036,0.2;3.411,1.876,0.2;2.561,2.562,0.2;2.179,2.420,0.2;2.757,3.024,0.3;3.439,3.970,0.3;4.084,3.036,0.3;3.402,2.077,0.3;2.879,3.036,0.4;3.421,3.793,0.4;3.953,3.036,0.4;3.402,2.219,0.4;3.000,3.047,0.5;3.430,3.639,0.5;3.822,3.012,0.5;3.411,2.385,0.5;3.103,3.012,0.6;3.430,3.462,0.6;3.710,3.036,0.6;3.402,2.562,0.6;3.224,3.047,0.7;3.411,3.260,0.7;3.542,3.024,0.7;3.393,2.763,0.7];

x=A(:,1);y=A(:,2);z=A(:,3);

scatter(x,y,5,z)%散点图

figure

[X,Y,Z]=griddata(x,y,z,linspace(1.486,4.271)',linspace(1.604,4.276),'v4');%插值

pcolor(X,Y,Z);shading interp%伪彩色图

figure,contourf(X,Y,Z) %等高线图

figure,surf(X,Y,Z)%三维曲面


x = rand(1,12);y = rand(1,12);z = rand(1,12); % now use some random z axis dataxi = linspace(min(x),max(x),30);        % x interpolation pointsyi = linspace(min(y),max(y),30);        % x interpolation points[Xi,Yi] = meshgrid(xi,yi);              % create grid of x and yZi = griddata(x,y,z,Xi,Yi);             % grid the data at Xi,Yi points% Zi = griddata(x,y,z,Xi,Yi, 'linear')          % same as above(default)% Zi = griddata(x,y,z,Xi,Yi, 'cubic')           % triangle based cubic interpolation% Zi = griddata(x,y,z,Xi,Yi, 'nearest') % triangle based nearest neighbor% Zi = griddata(x,y,z,Xi,Yi, 'invdist')         % inverse distance methodmesh(Xi,Yi,Zi)hold onplot3(x,y,z, 'ko')      % show original data as wellhold offtitle('Figure 18.10: Griddata Example') 

  

爱华网本文地址 » http://www.413yy.cn/a/25101018/371198.html

更多阅读

VBA编程中MsgBox函数怎么用 vba msgbox

VBA编程中MsgBox函数怎么用——简介Excel编程中的MsgBox函数用于输出一个对话框,该函数在编程调试以及输出结果方面具有极为重要的意义。下面小编就为大家讲解一下该函数的具体使用方法。VBA编程中MsgBox函数怎么用——方法/步骤

excel中round函数的使用方法 isodd函数的使用方法

excel中round函数的使用方法——简介不少朋友都会问在excel中round函数怎么用,作为使用频率较高函数之一,本文就介绍一下round函数的使用方法。excel中round函数的使用方法——工具/原料office excelexcel中round函数的使用方法——

Excel中COLUMN函数的使用 excel函数的使用方法

Excel中COLUMN函数的使用——简介COLUMN函数是一个简单的辅助函数,在一些复杂的函数计算中会使用到COLUMN函数,但是一般都不会对COLUMN函数作解析,很多朋友对公式函数中突然插入“=COLUMN()”表示理解。这里,为大家介绍COLUMN函数的使用。

matlab函数_连通区域转载 matlab 连通区域分析

matlab函数_连通区域1、 matlab函数bwareaopen──删除小面积对象格式:BW2 = bwareaopen(BW,P,conn)作用:删除二值图像BW中面积小于P的对象,默认情况下使用8邻域。算法:(1)Determine the connected components. L = bwlabeln(BW, conn)

声明:《转载 matlab中griddata函数应用示例 matlab函数调用示例》为网友紫色林蒙山区分享!如侵犯到您的合法权益请联系我们删除