当前位置:网站首页>【插值与拟合】
【插值与拟合】
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]

边栏推荐
猜你喜欢

进程和线程的区别&&run和start区别与联系

Tasks and task switching

MySQL installation to the last step in the write the configuration file failed?And after the installation steps

全国中职网络安全B模块之国赛题远程代码执行渗透测试 PHPstudy的后门漏洞分析

《c语言小游戏》入门级三子棋游戏(机器人加强版)

2022.07.14_Daily Question

Vscode:Project-tree插件

关于yum源的配置及更新

"C language game" entry-level chess game (robot enhanced version)

Practical Bioinformatics 2: Multi-omics data integration and mining
随机推荐
初识NK-RTU980开发板
Introduction and self-order of bcos
Client navicat installation tutorial
循环结构--for循环
超级详细的mysql数据库安装指南
动态顺序表的增删查改(C语言实现)
《opencv学习笔记》-- 仿射变换
使用PageHelper实现分页查询(详细)
MySQL安装到最后一步 write configuration file 失败 怎么办?及后安装步骤
正则表达式绕过
2022.07.29_Daily Question
DAY18: Xss Range Clearance Manual
二维坐标工具API
日志导致线程Block的这些坑,你不得不防
功能强大的国产Api管理工具
2022.07.26_Daily Question
第9章 异常try...except...else...finally
sort函数(快速排列)的使用方法
MySql 5.7.38下载安装教程 ,并实现在Navicat操作MySql
PowerCLi 通过自建PXE Server一键esxi7下批量部署常规New-VM