当前位置:网站首页>外插散点数据
外插散点数据
2022-07-03 10:53:00 【jk_101】
目录
影响外插准确性的因素
scatteredInterpolant 提供了对凸包外部的点求近似解值的功能。'linear' 外插方法基于凸包边界处梯度的最小二乘逼近。为凸包外部的查询点返回的值基于边界处的值和梯度。解的质量取决于数据采样的方式。如果是粗略数据采样,则外插的质量较差。
此外,靠近凸包边界的三角剖分可能具有条形三角形。这些三角形会影响外插结果,就像会影响插值结果一样。应利用对域外部行为的知识直观检查外插结果。
比较粗略采样和精细采样的散点数据的外插
本示例显示如何插入相同抛物线函数的两种不同采样。此示例说明更佳的采样点分布可以生成更好的外插结果。
围绕 10 个同心圆创建间距为 10 度的径向分布点。使用 bsxfun 计算坐标 x=cosθ 和 y=sinθ。
theta = 0:10:350;
c = cosd(theta);
s = sind(theta);
r = 1:10;
x1 = bsxfun(@times,r.',c);
y1 = bsxfun(@times,r.',s);
figure
plot(x1,y1,'*b')
axis equal如图所示:

创建第二个更粗略分布的点集。使用 rand 函数在范围 [-10, 10] 中创建随机采样。
rng default;
x2 = -10 + 20*rand([25 1]);
y2 = -10 + 20*rand([25 1]);
figure
plot(x2,y2,'*')如图所示:

在两个点集处对抛物线函数 v(x,y) 采样。
v1 = x1.^2 + y1.^2;
v2 = x2.^2 + y2.^2;针对 v(x,y) 的每个采样创建 scatteredInterpolant。
F1 = scatteredInterpolant(x1(:),y1(:),v1(:));
F2 = scatteredInterpolant(x2(:),y2(:),v2(:));创建将扩展到每个域外部的查询点网格。
[xq,yq] = ndgrid(-20:20);计算 F1 并绘制结果。
figure
vq1 = F1(xq,yq);
surf(xq,yq,vq1)如图所示:

计算 F2 并绘制结果。
figure
vq2 = F2(xq,yq);
surf(xq,yq,vq2)
如图所示:

由于对 v2 中的点进行了粗略采样,F2 的外插质量不佳。
三维数据外插
此示例说明如何使用 scatteredInterpolant 对良好采样的三维网格数据集进行外插。查询点位于完全处于域外部的平面网格上。
创建采样点的 10×10×10 网格。每个维度中的点都处于范围 [-10, 10] 中。
[x,y,z] = ndgrid(-10:10);在采样点处对函数 v(x,y,z) 采样。
v = x.^2 + y.^2 + z.^2;创建 scatteredInterpolant,并指定线性插值和外插。
F = scatteredInterpolant(x(:),y(:),z(:),v(:),'linear','linear');计算 x-y 网格中跨 [-20,20] 范围并且仰角为 z =15 时的插值。
[xq,yq,zq] = ndgrid(-20:20,-20:20,15);
vq = F(xq,yq,zq);
figure
surf(xq,yq,vq)如图所示:

由于对函数进行了良好采样,外插返回较佳结果。
边栏推荐
- 一些常用术语
- After using the thread pool for so long, do you really know how to reasonably configure the number of threads?
- Solve undefined reference to`__ aeabi_ Uidivmod 'and undefined reference to`__ aeabi_ Uidiv 'error
- Empire CMS no thumbnail smart tag (e:loop) two ways to judge whether there is a titlepic
- Event preview | the live broadcast industry "rolled in" to drive new data growth points with product power
- Mysql根据时间搜索常用方法整理
- (2) Base
- After a month, I finally got Kingdee offer! Share tetrahedral Sutra + review materials
- Stm32hal library upgrades firmware based on flash analog U disk (detailed explanation)
- R语言使用gridExtra包的grid.arrange函数将lattice包的多个可视化图像横向组合起来,ncol参数自定义组合图列数、nrow参数自定义组合图行数
猜你喜欢

Driver development based on I2C protocol

C语言 AES加解密

Intel 13th generation core flagship exposure, single core 5.5ghz

How to clean up v$rman_ backup_ job_ Details view reports error ora-02030

基于I2C协议的驱动开发

Understand go language context in one article

软考中级软件设计师该怎么备考

ASP.NET-酒店管理系统

活动预告 | 直播行业“内卷”,以产品力拉动新的数据增长点

Numpy np.max和np.maximum实现relu函数
随机推荐
导师对帮助研究生顺利完成学业提出了20条劝告:第一,不要有度假休息的打算.....
R language uses grid of gridextra package The array function combines multiple visual images of the ggplot2 package horizontally, and the ncol parameter defines the number of columns of the combined g
Understand go language context in one article
Execute kubectl on Tencent cloud container service node
How to become a senior digital IC Design Engineer (1-3) Verilog coding syntax: Verilog behavior level, register transfer level, gate level (abstract level)
How to get started embedded future development direction of embedded
Xml的(DTD,xml解析,xml建模)
(2) Base
用了这么久线程池,你真的知道如何合理配置线程数吗?
R语言使用gridExtra包的grid.arrange函数将ggplot2包的多个可视化图像横向组合起来,ncol参数自定义组合图列数、nrow参数自定义组合图行数
[vtk] interpretation of source code comments of vtkwindowedsincpolydatafilter
The LINQ expression node type 'ArrayIndex' is not supported in LINQ to Entities
Programmers' entrepreneurial trap: taking private jobs
STL教程9-容器元素深拷贝和浅拷贝问题
2022 northeast four provinces match VP record / supplementary questions
Function details of CorelDRAW graphics suite 2022
Processes and threads
How to make others fear you
VPP三层网络互联配置
Oracle withdraw permission & create role