⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 splineex.m

📁 matlab code for new user to design any project
💻 M
字号:


% demonstrate spline and polyint functions

clear;                                 % clear variables

min = -5;                              % range of x values
max = 5;
x = min:1:max;                         % define x values

y = sin(x);	                       % define y values

xi = min:0.1:max;                      % x values to be interpolated at
yi = spline(x,y,xi);                   % spline interpolation
yii = polyint(x,y,xi);                 % polynomial interpolation

plot (x,y,'o',xi,yi,'-',xi,yii,'-.');  % plot and compare

legend('raw data','cubic spline','poly inter');

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -