当前位置:网站首页>【插值与拟合】
【插值与拟合】
2022-07-31 07:38:00 【是数学系的小孩儿】
插值
x0=[0 3 5 7 9 11 12 13 14 15];
y0=[0 1.2 1.7 2.0 2.1 2.0 1.8 1.2 1.0 1.6];
x=0:0.1:15;
y1=interp1(x0,y0,x);
y2=interp1(x0,y0,x,'spline');%一维插值函数
pp1=csape(x0,y0);
y3=fnval(pp1,x);
pp2=csape(x0,y0,'second');
y4=fnval(pp2,x);
[x',y1',y2',y3',y4']
subplot(1,3,1)
plot(x0,y0,'+',x,y1)
xlabel('x方向')
ylabel('y方向')
title('分段线性插值')
%%
subplot(1,3,2)
plot(x0,y0,'+',x,y2)
xlabel('x方向')
ylabel('y方向')
title('立方样条插值')
%%
subplot(1,3,3)
plot(x0,y0,'+',x,y3)
xlabel('x方向')
ylabel('y方向')
title('立方样条插值有边界条件,边界为二阶导数')
%%
dx=diff(x);
dy=diff(y3);
dy_dx=dy./dx;
dy_dx0=dy_dx(1)
ytemp=y3(131:151);
ymin=min(ytemp);
index=find(y3==ymin);
xmin=x(index);
[xmin,ymin]
边栏推荐
- Collation and sharing of related classic papers and datasets in the field of deep learning communication
- New in Visual Studio: Low Priority Builds
- MySQL 5.7详细下载安装配置教程
- Vulkan与OpenGL对比——Vulkan的全新渲染架构
- 报销流程|By天放师兄
- MySQL detailed explanation
- ros小乌龟画图
- MySQL 5.7 安装教程(全步骤、保姆级教程)
- First acquaintance with NK-RTU980 development board
- 《opencv学习笔记》-- 仿射变换
猜你喜欢
随机推荐
Navicat new database
【Objective-C语言中的@property】
控制文本保留几行,末尾省略
Zabbix6.2 Surprise Release!Especially optimize the performance of medium and large environment deployment!
interrupt and pendSV
2022.07.20_Daily Question
MySQL安装常见报错处理大全
CNN--各层的介绍
MySql数据库优化查询工具
Leetcode952. Calculate maximum component size by common factor
Regarding "computing power", this article is worth reading
安装部署KubeSphere管理kubernetes
Financial leasing business
ros小乌龟画图
TypeError The view function did not return a valid response. The function either returned None 的解决
《如何戒掉坏习惯》读书笔记
mysql安装教程【安装版】
使用PageHelper实现分页查询(详细)
Jetpack Compose学习(8)——State及remeber
[PSQL] Complex query