当前位置:网站首页>【插值与拟合】
【插值与拟合】
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]
边栏推荐
猜你喜欢
PowerCLi 通过自建PXE Server一键esxi7下批量部署常规New-VM
How to set the computer password?How to add "safety lock" to your computer
一文搞定代码中的命名
WLAN部署(AC+AP)配置及常见问题记录
MySql database optimization query tool
mysql安装教程【安装版】
sqli-labs(less-11)
Machine Learning - Notes and Implementation of Linear Regression, Logistic Regression Problems
《C语言小游戏》扫雷
2022.07.24_Daily Question
随机推荐
Docker-compose安装mysql
深度理解递归,手撕经典递归问题(汉诺塔,青蛙跳台阶),保姆级教学。
2022.07.29_Daily Question
2022.07.13 _ a day
ros little turtle drawing
google搜索技巧——程序员推荐
Tasks and task switching
Collation and sharing of related classic papers and datasets in the field of deep learning communication
开源|商品识别推荐系统
tqdm库的使用
MySQL安装教程
2022.07.12_Daily Question
Shell编程之条件语句
mysql insert new field method
超级详细的mysql数据库安装指南
《c语言》青蛙跳台阶递归问题
Financial leasing business
mysql的建表语句_三种常用的MySQL建表语句
Zabbix6.2 Surprise Release!Especially optimize the performance of medium and large environment deployment!
[PSQL] SQL Basic Course Reading Notes (Chapter1-4)